Skip to content

Commit 7dcad20

Browse files
committed
Local: Handle noalias.addrspace in copyMetadataForLoad
1 parent f7b9b84 commit 7dcad20

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

llvm/lib/Transforms/Utils/Local.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3473,6 +3473,7 @@ void llvm::copyMetadataForLoad(LoadInst &Dest, const LoadInst &Source) {
34733473
case LLVMContext::MD_mem_parallel_loop_access:
34743474
case LLVMContext::MD_access_group:
34753475
case LLVMContext::MD_noundef:
3476+
case LLVMContext::MD_noalias_addrspace:
34763477
// All of these directly apply.
34773478
Dest.setMetadata(ID, N);
34783479
break;

llvm/test/Transforms/InstCombine/loadstore-metadata.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ define i32 @test_load_cast_combine_noalias_addrspace(ptr %ptr) {
177177
; Ensure (cast (load (...))) -> (load (cast (...))) preserves TBAA.
178178
; CHECK-LABEL: @test_load_cast_combine_noalias_addrspace(
179179
; CHECK-NEXT: entry:
180-
; CHECK-NEXT: [[L1:%.*]] = load i32, ptr [[PTR:%.*]], align 4
180+
; CHECK-NEXT: [[L1:%.*]] = load i32, ptr [[PTR:%.*]], align 4, !noalias.addrspace [[META10:![0-9]+]]
181181
; CHECK-NEXT: ret i32 [[L1]]
182182
;
183183
entry:

0 commit comments

Comments
 (0)