[opt](expr) vectorize nullable comparison predicates - #66688
Open
Mryange wants to merge 2 commits into
Open
Conversation
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary: Nullable comparison predicate loops used short-circuit logical AND when combining the null map with the comparison result. This prevented SIMD code generation for ColumnElementView inputs. Use bitwise AND on boolean operands so Clang can vectorize both assign and AND predicate paths. The isolated second-predicate benchmark improves from 1.188 to 0.393 ns/row for 4096-row batches and from 0.857 to 0.393 ns/row for 8192-row batches.
### Release note
None
### Check List (For Author)
- Test: Manual test
- Built benchmark_test with sh build.sh --benchmark -j48 and ran focused comparison predicate benchmarks.
- Behavior changed: No
- Does this need documentation: No
Issue Number: None
Related PR: None
Problem Summary: Add a Doris-only benchmark for comparison predicate evaluation across nullable layouts, predicate combinations, profile-scope selection compaction, and code-generation variants.
None
- Test: Manual test
- Built benchmark_test with sh build.sh --benchmark -j48 and ran focused production and code-generation cases.
- Behavior changed: No
- Does this need documentation: No
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
TPC-H: Total hot run time: 28765 ms |
Contributor
TPC-DS: Total hot run time: 156824 ms |
Contributor
ClickBench: Total hot run time: 24.05 s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Nullable comparison predicates used short-circuit
&&to combine the null map and comparison result. WithColumnElementView, Clang generated a scalar loop instead of SIMD instructions.This PR uses bitwise
&for the two boolean operands, preserving the result while allowing vectorization. It also adds a focused comparison predicate benchmark.Assembly changes from scalar
cmp/testoperations per row to vectorizedvpcmpgtdandvpandoperations over multiple rows.Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)