IMPALA-5479: Propagate the argument type in RawValue::Compare()
CodegenAnyVal::Compare() generates code which calls the cross
compiled version of RawValue::Compare() without propagating
the type information into RawValue::Compare(). As a result,
the generated code of RawValue::Compare() is not any more
efficient than the interpreted version as we still have
the big switch statement in it.
This change creates a global constant for the argument 'type'
passed to RawValue::Compare(). By inlining the call to
RawValue::Compare(), LLVM was able to constant propagate
the type and eliminate the dead code for non-target types.
With this change, a query with top-n improves by 12% on average:
select l_orderkey, l_partkey, l_suppkey
order by l_orderkey, l_partkey, l_suppkey
4.49s -> 3.95s
This change also adds the ALWAYS_INLINE attribute to
RuntimeFilter::Eval() as it's needed to propagate the type
after a recent change to not put ALWAYS_INLINE attribute
on all cross-compiled functions.
Reviewed-by: Tim Armstrong <firstname.lastname@example.org>
Tested-by: Impala Public Jenkins