[InstCombine][AIEX] Add load->trunc->inttoptr combine pattern#837
Open
andcarminati wants to merge 1 commit intoaie-publicfrom
Open
[InstCombine][AIEX] Add load->trunc->inttoptr combine pattern#837andcarminati wants to merge 1 commit intoaie-publicfrom
andcarminati wants to merge 1 commit intoaie-publicfrom
Conversation
b8771ec to
4d4609e
Compare
InstCombine optimization for load->trunc->inttoptr pattern on aie The aie target has 20-bit pointers, which are stored as i24 (3 bytes) This optimization converts: load i24 -> trunc i20 -> inttoptr Into: load ptr -> ptrtoint -> zext i24 This allows SROA to recognize pointer-only allocas and promote them
4d4609e to
3d317a1
Compare
F-Stuckmann
reviewed
Apr 8, 2026
| // CHECK-NEXT: entry: | ||
| // CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aie2p.put.ms.nb(i32 [[VAL:%.*]], i32 [[TLAST:%.*]]) | ||
| // CHECK-NEXT: [[TOBOOL_I:%.*]] = icmp ne i32 [[TMP0]], 0 | ||
| // CHECK-NEXT: [[FROMBOOL_I:%.*]] = zext i1 [[TOBOOL_I]] to i8 |
Collaborator
There was a problem hiding this comment.
do we have to update the tests?
F-Stuckmann
reviewed
Apr 8, 2026
Collaborator
F-Stuckmann
left a comment
There was a problem hiding this comment.
If you want to NRC update the labels in unit-tests could this be commit 1? Commit 2 could be the baseline unit-test and 3 then the actual implementation?
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.
InstCombine optimization for load->trunc->inttoptr pattern on aie The aie target has 20-bit pointers, which are stored as i24 (3 bytes) This optimization converts: load i24 -> trunc i20 -> inttoptr Into: load ptr -> ptrtoint -> zext i24
This allows SROA to recognize pointer-only allocas and promote them