-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Local: Handle noalias.addrspace in copyMetadataForLoad #103939
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
Local: Handle noalias.addrspace in copyMetadataForLoad #103939
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
@llvm/pr-subscribers-llvm-transforms Author: Matt Arsenault (arsenm) ChangesFull diff: https://github.com/llvm/llvm-project/pull/103939.diff 2 Files Affected:
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index bbc8933d387e1..884ace14b90b7 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -3398,6 +3398,7 @@ void llvm::copyMetadataForLoad(LoadInst &Dest, const LoadInst &Source) {
case LLVMContext::MD_mem_parallel_loop_access:
case LLVMContext::MD_access_group:
case LLVMContext::MD_noundef:
+ case LLVMContext::MD_noalias_addrspace:
// All of these directly apply.
Dest.setMetadata(ID, N);
break;
diff --git a/llvm/test/Transforms/InstCombine/loadstore-metadata.ll b/llvm/test/Transforms/InstCombine/loadstore-metadata.ll
index 247a02f0bcc14..dccbfbd13f73d 100644
--- a/llvm/test/Transforms/InstCombine/loadstore-metadata.ll
+++ b/llvm/test/Transforms/InstCombine/loadstore-metadata.ll
@@ -177,7 +177,7 @@ define i32 @test_load_cast_combine_noalias_addrspace(ptr %ptr) {
; Ensure (cast (load (...))) -> (load (cast (...))) preserves TBAA.
; CHECK-LABEL: @test_load_cast_combine_noalias_addrspace(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[L1:%.*]] = load i32, ptr [[PTR:%.*]], align 4
+; CHECK-NEXT: [[L1:%.*]] = load i32, ptr [[PTR:%.*]], align 4, !noalias.addrspace [[META10:![0-9]+]]
; CHECK-NEXT: ret i32 [[L1]]
;
entry:
|
1952386 to
0f1cd91
Compare
1f6e229 to
a9627b2
Compare
0f1cd91 to
3ff8ae8
Compare
a9627b2 to
865a467
Compare
3ff8ae8 to
f7b9b84
Compare
865a467 to
7dcad20
Compare
f7b9b84 to
4e5e920
Compare
7dcad20 to
b655b4c
Compare
|
ping |
| } | ||
|
|
||
| define i32 @test_load_cast_combine_noalias_addrspace(ptr %ptr) { | ||
| ; Ensure (cast (load (...))) -> (load (cast (...))) preserves TBAA. |
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.
Should this comment reference noalias.addrspace rather than TBAA?
frasercrmck
left a comment
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.
LGTM other than nit
8c22443
into
users/arsenm/combine-metadata-preserve-noalias-addrspace

No description provided.