Improve SIMD code generation for primitive predicates

This adds a local (on-stack) copy of the bounds for range and equality
predicates before evaluating them against the columns. These on-stack
copies help the compiler realize that the stores to the selection vector
can't overwrite the predicate itself, and thus allows SIMD code
generation.

Benchmarked with column_predicate-test. Highlighting the 'NOT NULL'
results (since this doesn't change the evaluation of nulls):

Before:
 int8   NOT NULL   (c >= 0 AND c < 2) 1363.5M evals/sec	2.09 cycles/eval
 int16  NOT NULL   (c >= 0 AND c < 2) 1238.3M evals/sec	2.30 cycles/eval
 int32  NOT NULL   (c >= 0 AND c < 2) 1321.3M evals/sec	2.15 cycles/eval
 int64  NOT NULL   (c >= 0 AND c < 2) 1408.3M evals/sec	2.02 cycles/eval
 float  NOT NULL   (c >= 0 AND c < 2) 1134.8M evals/sec	2.52 cycles/eval
 double NOT NULL   (c >= 0 AND c < 2) 1144.2M evals/sec	2.49 cycles/eval

After:
 int8   NOT NULL   (c >= 0 AND c < 2) 3152.2M evals/sec	0.88 cycles/eval
 int16  NOT NULL   (c >= 0 AND c < 2) 3309.6M evals/sec	0.85 cycles/eval
 int32  NOT NULL   (c >= 0 AND c < 2) 3384.0M evals/sec	0.85 cycles/eval
 int64  NOT NULL   (c >= 0 AND c < 2) 1847.6M evals/sec	1.57 cycles/eval
 float  NOT NULL   (c >= 0 AND c < 2) 3268.3M evals/sec	0.88 cycles/eval
 double NOT NULL   (c >= 0 AND c < 2) 2245.2M evals/sec	1.27 cycles/eval

The numbers for non-range predicates didn't seem to change here.

Change-Id: I1772584c1d0c53128608ea26248dd4ab069b8108
Reviewed-on: http://gerrit.cloudera.org:8080/14855
Reviewed-by: Adar Dembo <adar@cloudera.com>
Tested-by: Kudu Jenkins
2 files changed