-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[VPlan] Implement printing VPIRMetadata. #168385
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
Merged
Changes from all 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
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 |
|---|---|---|
|
|
@@ -7,11 +7,16 @@ define void @test_widen_metadata(ptr noalias %A, ptr noalias %B, i32 %n) { | |
| ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' { | ||
| ; CHECK: <x1> vector loop: { | ||
| ; CHECK: vector.body: | ||
| ; CHECK: WIDEN ir<%lv> = load vp<{{.*}}> | ||
| ; CHECK: WIDEN-CAST ir<%conv> = sitofp ir<%lv> to float | ||
| ; CHECK: WIDEN ir<%mul> = fmul ir<%conv>, ir<2.000000e+00> | ||
| ; CHECK: WIDEN ir<%lv> = load vp<{{.*}}> (!tbaa ![[TBAA:[0-9]+]]) | ||
| ; CHECK: WIDEN-CAST ir<%conv> = sitofp ir<%lv> to float (!fpmath ![[FPMATH:[0-9]+]]) | ||
| ; CHECK: WIDEN ir<%mul> = fmul ir<%conv>, ir<2.000000e+00> (!fpmath ![[FPMATH]]) | ||
| ; CHECK: WIDEN-CAST ir<%conv.back> = fptosi ir<%mul> to i32 | ||
| ; CHECK: WIDEN store vp<{{.*}}>, ir<%conv.back> | ||
| ; CHECK: WIDEN store vp<{{.*}}>, ir<%conv.back> (!tbaa ![[TBAA]]) | ||
| ; CHECK: ir-bb<loop>: | ||
| ; CHECK: IR %lv = load i32, ptr %gep.A, align 4, !tbaa ![[TBAA]] | ||
| ; CHECK: IR %conv = sitofp i32 %lv to float, !fpmath ![[FPMATH]] | ||
| ; CHECK: IR %mul = fmul float %conv, 2.000000e+00, !fpmath ![[FPMATH]] | ||
| ; CHECK: IR store i32 %conv.back, ptr %gep.B, align 4, !tbaa ![[TBAA]] | ||
| ; | ||
| entry: | ||
| br label %loop | ||
|
|
@@ -40,9 +45,13 @@ define void @test_intrinsic_with_metadata(ptr noalias %A, ptr noalias %B, i32 %n | |
| ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' { | ||
| ; CHECK: <x1> vector loop: { | ||
| ; CHECK: vector.body: | ||
| ; CHECK: WIDEN ir<%lv> = load vp<{{.*}}> | ||
| ; CHECK: WIDEN-INTRINSIC ir<%sqrt> = call llvm.sqrt(ir<%lv>) | ||
| ; CHECK: WIDEN store vp<{{.*}}>, ir<%sqrt> | ||
| ; CHECK: WIDEN ir<%lv> = load vp<{{.*}}> (!tbaa ![[TBAA2:[0-9]+]]) | ||
| ; CHECK: WIDEN-INTRINSIC ir<%sqrt> = call llvm.sqrt(ir<%lv>) (!fpmath ![[FPMATH2:[0-9]+]]) | ||
| ; CHECK: WIDEN store vp<{{.*}}>, ir<%sqrt> (!tbaa ![[TBAA2]]) | ||
| ; CHECK: ir-bb<loop>: | ||
| ; CHECK: IR %lv = load float, ptr %gep.A, align 4, !tbaa ![[TBAA2]] | ||
| ; CHECK: IR %sqrt = call float @llvm.sqrt.f32(float %lv), !fpmath ![[FPMATH2]] | ||
| ; CHECK: IR store float %sqrt, ptr %gep.B, align 4, !tbaa ![[TBAA2]] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it worth also dumping the CHECK lines for TBAA2 at the bottom of the file by adding the global attributes? |
||
| ; | ||
| entry: | ||
| br label %loop | ||
|
|
@@ -67,11 +76,14 @@ define void @test_widen_with_multiple_metadata(ptr noalias %A, ptr noalias %B, i | |
| ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' { | ||
| ; CHECK: <x1> vector loop: { | ||
| ; CHECK: vector.body: | ||
| ; CHECK: WIDEN ir<%lv> = load vp<{{.*}}> | ||
| ; CHECK: WIDEN ir<%lv> = load vp<{{.*}}> (!tbaa ![[TBAA3:[0-9]+]]) | ||
| ; CHECK: WIDEN-CAST ir<%conv> = sitofp ir<%lv> to float | ||
| ; CHECK: WIDEN ir<%mul> = fmul ir<%conv>, ir<2.000000e+00> | ||
| ; CHECK: WIDEN-CAST ir<%conv.back> = fptosi ir<%mul> to i32 | ||
| ; CHECK: WIDEN store vp<{{.*}}>, ir<%conv.back> | ||
| ; CHECK: WIDEN store vp<{{.*}}>, ir<%conv.back> (!tbaa ![[TBAA3]]) | ||
| ; CHECK: ir-bb<loop>: | ||
| ; CHECK: IR %lv = load i32, ptr %gep.A, align 4, !tbaa ![[TBAA3]] | ||
| ; CHECK: IR store i32 %conv.back, ptr %gep.B, align 4, !tbaa ![[TBAA3]] | ||
| ; | ||
| entry: | ||
| br label %loop | ||
|
|
||
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
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.
I wonder if these checks should actually live somewhere in the vplan verifier, rather than only checking when someone is dumping the recipe?
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 think we can ensure
Kind != 0on construction, the other is only related to printing, so I kept it