You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2026/10/07 02:50:00 UTC

[jira] [Commented] (IMPALA-11917) Upgrade to LLVM/Clang 22 and GCC 15

    [ https://issues.apache.org/jira/browse/IMPALA-11917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18124234#comment-18124234 ] 

ASF subversion and git services commented on IMPALA-11917:
----------------------------------------------------------

Commit 893cf933b6880ab7dd30bc9f6b16eac71c92e8f5 in impala's branch refs/heads/master from Michael Smith
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=893cf933b ]

IMPALA-11917: Codegen branch-free reads of nullable scalar slots

After the LLVM 22 upgrade, TPC-DS Q99's streaming aggregation was ~20%
slower than with LLVM 5. Its UpdateTuple compiled to 269 instructions
with 22 branches (LLVM 5: 84 instructions, 5 branches).

GetSlotRef wraps each slot read in a null-check diamond. Once several
reads of the same slots are inlined into a single function, LLVM 22
no longer merges these diamonds. Each read keeps its own branch and
conditional load, and the packed *Val is rebuilt via shifts and cmovs.
Replacing the phi with a select after the branch doesn't help, because
InstCombine converts a select back into a phi when a dominating branch
tests the same condition.

When the tuple is not nullable and the slot is a nullable simple scalar
(i.e. not string, timestamp, collection, struct or variant), GetSlotRef
now loads the slot unconditionally and selects on the null bit. This
is safe because the slot is always within the tuple's memory. With no
branch on the null bit, LLVM combines the null checks and CSEs the
loads across expressions, so UpdateTuple compiles to 88 instructions
with 6 branches. 09:AGGREGATE STREAMING in Q99 drops from 39-41ms to
32-33ms, matching LLVM 5.

Codegen for other types didn't change as they showed no improvement.

Testing:
- Q99 results on tpcds20_parquet match with codegen enabled and
  disabled.
- Ran tests/query_test/test_tpcds_queries.py.

Change-Id: I6edaf90100cc3360a7c93d3218eb6956fcec24f0
Assisted-by: Claude Opus 5.5 (GitHub Copilot)
Reviewed-on: http://gerrit.cloudera.org:8080/24997
Reviewed-by: Michael Smith <mi...@cloudera.com>
Reviewed-by: Joe McDonnell <jo...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> Upgrade to LLVM/Clang 22 and GCC 15
> -----------------------------------
>
>                 Key: IMPALA-11917
>                 URL: https://issues.apache.org/jira/browse/IMPALA-11917
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Backend
>            Reporter: Quanlong Huang
>            Assignee: Michael Smith
>            Priority: Major
>             Fix For: Impala 5.0.0
>
>
> LLVM 7.0 adds a JITEventListener for integration with Linux perf in createPerfJITEventListener(). We can consider replacing our customized listener (CodegenSymbolEmitter) with it.
> [https://github.com/llvm/llvm-project/commit/376a3d3659e3ee5ea47517e3e43022f0306ecc74]
> [https://releases.llvm.org/7.0.0/docs/ReleaseNotes.html]
> We are currently using llvm version 5. llvm 18 is the latest released version. There is scope for utilizing improved optimization passes and other improvements that come with the newer versions.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org