Internal Jenkins has submitted this change and it was merged.

Change subject: IMPALA-3115: Hoist some variables out of loops in 
cross-compiled code.
......................................................................


IMPALA-3115: Hoist some variables out of loops in cross-compiled code.

This change adds the compiler hint __restrict__ to indicate that input
arguments of some cross-compiled functions have no aliases. This
allows the compiler to hoist some variables such as loop bounds
(e.g out_batch->num_rows()) out of the loop. In addition, this change
introduces an iterator interface for RowBatch to avoid the multiplication
inside loops when RowBatch::GetRow() is called. Apparently, specifying the
no alias hint isn't always sufficient for clang to convert multiplication
to addition in the loop. Hoisting of variables was confirmed to occur via
manual inspection of the generated IR.

With this change, some queries in targeted perf such as PERF_AGG-Q4 has
more than 10% improvement on average. TARGETED_PERF(15) and TPCH_NESTED(300)
shows about 1% improvement.

Change-Id: Ic7152b1fb094b3c3574d203e3774f4297f2225dc
Reviewed-on: http://gerrit.cloudera.org:8080/2661
Reviewed-by: Michael Ho <[email protected]>
Tested-by: Internal Jenkins
---
M be/src/exec/hash-table.cc
M be/src/exec/hash-table.h
M be/src/exec/hash-table.inline.h
M be/src/exec/partitioned-aggregation-node-ir.cc
M be/src/exec/partitioned-aggregation-node.cc
M be/src/exec/partitioned-aggregation-node.h
M be/src/exec/partitioned-hash-join-node-ir.cc
M be/src/exec/partitioned-hash-join-node.cc
M be/src/exec/partitioned-hash-join-node.h
M be/src/runtime/row-batch.h
M be/src/runtime/tuple-row.h
11 files changed, 183 insertions(+), 117 deletions(-)

Approvals:
  Michael Ho: Looks good to me, approved
  Internal Jenkins: Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/2661
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic7152b1fb094b3c3574d203e3774f4297f2225dc
Gerrit-PatchSet: 10
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Michael Ho <[email protected]>
Gerrit-Reviewer: Dan Hecht <[email protected]>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Michael Ho <[email protected]>
Gerrit-Reviewer: Tim Armstrong <[email protected]>

Reply via email to