-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[InstCombine] Don't look at ConstantData users #103302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
aengelke
merged 6 commits into
main
from
users/aengelke/spr/instcombine-dont-look-at-constantdata-users
Aug 13, 2024
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
73428f8
[𝘀𝗽𝗿] initial version
aengelke b7da0e9
[𝘀𝗽𝗿] changes to main this commit is based on
paulwalker-arm 6a2ac00
Only run instcombine in test case
aengelke b21d802
Reduce test case
aengelke b806aa0
[𝘀𝗽𝗿] changes introduced through rebase
topperc dd2fcfb
rebase
aengelke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 | ||
; RUN: opt -S < %s -passes=instcombine | FileCheck %s | ||
|
||
; Verify that instcombine doesn't look at users of Constant in different | ||
; functions for dominates() queries. | ||
|
||
define void @f1(i1 %a) { | ||
; CHECK-LABEL: define void @f1( | ||
; CHECK-SAME: i1 [[A:%.*]]) { | ||
; CHECK-NEXT: br label %[[BB1:.*]] | ||
; CHECK: [[BB1]]: | ||
; CHECK-NEXT: br i1 [[A]], label %[[BB3:.*]], label %[[BB2:.*]] | ||
; CHECK: [[BB2]]: | ||
; CHECK-NEXT: br label %[[BB3]] | ||
; CHECK: [[BB3]]: | ||
; CHECK-NEXT: [[PHI:%.*]] = phi i64 [ 0, %[[BB2]] ], [ 1, %[[BB1]] ] | ||
; CHECK-NEXT: [[INTTOPTR:%.*]] = inttoptr i64 [[PHI]] to ptr | ||
; CHECK-NEXT: store i32 0, ptr [[INTTOPTR]], align 4 | ||
; CHECK-NEXT: br label %[[BB1]] | ||
; | ||
br label %bb1 | ||
|
||
bb1: | ||
br i1 %a, label %bb3, label %bb2 | ||
|
||
bb2: | ||
br label %bb3 | ||
|
||
bb3: | ||
%phi = phi i64 [ 0, %bb2 ], [ 1, %bb1 ] | ||
%inttoptr = inttoptr i64 %phi to ptr | ||
store i32 0, ptr %inttoptr, align 4 | ||
br label %bb1 | ||
} | ||
|
||
define void @f2() { | ||
; CHECK-LABEL: define void @f2() { | ||
; CHECK-NEXT: [[BB:.*:]] | ||
; CHECK-NEXT: ret void | ||
; | ||
bb: | ||
%inttoptr = inttoptr i64 0 to ptr | ||
ret void | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test still doesn't look anything approaching minimal. Please run it through llvm-reduce.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Fun fact, llvm-reduce crashed on the input due to this bug.