Repository navigation
[MergeFunctions] Intersect poison-generating flags #220015
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
+109
−30
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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,86 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6 | ||
| ; RUN: opt -S -passes=mergefunc < %s | FileCheck %s | ||
|
|
||
| define i32 @fn_add_nuw_nsw(i32 %a) { | ||
| ; CHECK-LABEL: define i32 @fn_add_nuw_nsw( | ||
| ; CHECK-SAME: i32 [[A:%.*]]) { | ||
| ; CHECK-NEXT: [[ADD:%.*]] = add nuw i32 [[A]], 1 | ||
| ; CHECK-NEXT: ret i32 [[ADD]] | ||
| ; | ||
| %add = add nuw nsw i32 %a, 1 | ||
| ret i32 %add | ||
| } | ||
|
|
||
| define internal i32 @fn_add_nuw(i32 %a) { | ||
| %add = add nuw i32 %a, 1 | ||
| ret i32 %add | ||
| } | ||
|
|
||
| define ptr @fn_gep_inbounds(ptr %a) { | ||
| ; CHECK-LABEL: define ptr @fn_gep_inbounds( | ||
| ; CHECK-SAME: ptr [[A:%.*]]) { | ||
| ; CHECK-NEXT: [[GEP:%.*]] = getelementptr nusw i8, ptr [[A]], i64 1 | ||
| ; CHECK-NEXT: ret ptr [[GEP]] | ||
| ; | ||
| %gep = getelementptr inbounds i8, ptr %a, i64 1 | ||
| ret ptr %gep | ||
| } | ||
|
|
||
| define internal ptr @fn_gep_nusw(ptr %a) { | ||
| %gep = getelementptr nusw i8, ptr %a, i64 1 | ||
| ret ptr %gep | ||
| } | ||
|
|
||
| define ptr @fn_gep_inbounds2(ptr %a) { | ||
| ; CHECK-LABEL: define ptr @fn_gep_inbounds2( | ||
| ; CHECK-SAME: ptr [[A:%.*]]) { | ||
| ; CHECK-NEXT: [[GEP:%.*]] = getelementptr i8, ptr [[A]], i64 2 | ||
| ; CHECK-NEXT: ret ptr [[GEP]] | ||
| ; | ||
| %gep = getelementptr inbounds i8, ptr %a, i64 2 | ||
| ret ptr %gep | ||
| } | ||
|
|
||
| define internal ptr @fn_gep_nuw(ptr %a) { | ||
| %gep = getelementptr nuw i8, ptr %a, i64 2 | ||
| ret ptr %gep | ||
| } | ||
|
|
||
| define float @fn_fadd_ninf_nnan(float %a) { | ||
| ; CHECK-LABEL: define float @fn_fadd_ninf_nnan( | ||
| ; CHECK-SAME: float [[A:%.*]]) { | ||
| ; CHECK-NEXT: [[ADD:%.*]] = fadd ninf float [[A]], 1.000000e+00 | ||
| ; CHECK-NEXT: ret float [[ADD]] | ||
| ; | ||
| %add = fadd ninf nnan float %a, 1.0 | ||
| ret float %add | ||
| } | ||
|
|
||
| define internal float @fn_fadd_ninf_reassoc(float %a) { | ||
| %add = fadd ninf reassoc float %a, 1.0 | ||
| ret float %add | ||
| } | ||
|
|
||
| define void @calls(i32 %x, ptr %p, float %f) { | ||
| ; CHECK-LABEL: define void @calls( | ||
| ; CHECK-SAME: i32 [[X:%.*]], ptr [[P:%.*]], float [[F:%.*]]) { | ||
| ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @fn_add_nuw_nsw(i32 [[X]]) | ||
| ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @fn_add_nuw_nsw(i32 [[X]]) | ||
| ; CHECK-NEXT: [[TMP3:%.*]] = call ptr @fn_gep_inbounds(ptr [[P]]) | ||
| ; CHECK-NEXT: [[TMP4:%.*]] = call ptr @fn_gep_inbounds(ptr [[P]]) | ||
| ; CHECK-NEXT: [[TMP5:%.*]] = call ptr @fn_gep_inbounds2(ptr [[P]]) | ||
| ; CHECK-NEXT: [[TMP6:%.*]] = call ptr @fn_gep_inbounds2(ptr [[P]]) | ||
| ; CHECK-NEXT: [[TMP7:%.*]] = call float @fn_fadd_ninf_nnan(float [[F]]) | ||
| ; CHECK-NEXT: [[TMP8:%.*]] = call float @fn_fadd_ninf_nnan(float [[F]]) | ||
| ; CHECK-NEXT: ret void | ||
| ; | ||
| call i32 @fn_add_nuw_nsw(i32 %x) | ||
| call i32 @fn_add_nuw(i32 %x) | ||
| call ptr @fn_gep_inbounds(ptr %p) | ||
| call ptr @fn_gep_nusw(ptr %p) | ||
| call ptr @fn_gep_inbounds2(ptr %p) | ||
| call ptr @fn_gep_nuw(ptr %p) | ||
| call float @fn_fadd_ninf_nnan(float %f) | ||
| call float @fn_fadd_ninf_reassoc(float %f) | ||
| 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.
Minor nit: the comment was quite stale, though perhaps we could still mention that we do test the tail bit on calls later (CallBase branch)?
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.
I went ahead and just dropped this comment entirely. I don't think it really provides useful information.