[llvm] r349774 - [InstCombine] Preserve access-group metadata.
Michael Kruse via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 20 09:11:03 PST 2018
Author: meinersbur
Date: Thu Dec 20 09:11:02 2018
New Revision: 349774
URL: http://llvm.org/viewvc/llvm-project?rev=349774&view=rev
Log:
[InstCombine] Preserve access-group metadata.
Preserve llvm.access.group metadata when combining store instructions.
This was forgotten in r349725.
Fixes llvm.org/PR40117
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
llvm/trunk/test/Transforms/InstCombine/bitcast-store.ll
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp?rev=349774&r1=349773&r2=349774&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp Thu Dec 20 09:11:02 2018
@@ -553,10 +553,10 @@ static StoreInst *combineStoreToNewValue
case LLVMContext::MD_noalias:
case LLVMContext::MD_nontemporal:
case LLVMContext::MD_mem_parallel_loop_access:
+ case LLVMContext::MD_access_group:
// All of these directly apply.
NewStore->setMetadata(ID, N);
break;
-
case LLVMContext::MD_invariant_load:
case LLVMContext::MD_nonnull:
case LLVMContext::MD_range:
Modified: llvm/trunk/test/Transforms/InstCombine/bitcast-store.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/bitcast-store.ll?rev=349774&r1=349773&r2=349774&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/bitcast-store.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/bitcast-store.ll Thu Dec 20 09:11:02 2018
@@ -10,11 +10,11 @@ target datalayout = "e-p:64:64:64-i1:8:8
@G = external constant [5 x i8*]
; CHECK-LABEL: @foo
-; CHECK: store i32 %x, i32* %{{.*}}, align 16, !noalias !0
+; CHECK: store i32 %x, i32* %{{.*}}, align 16, !noalias !0, !llvm.access.group !1
define void @foo(i32 %x, float* %p) nounwind {
entry:
%x.cast = bitcast i32 %x to float
- store float %x.cast, float* %p, align 16, !noalias !0
+ store float %x.cast, float* %p, align 16, !noalias !0, !llvm.access.group !1
ret void
}
@@ -48,3 +48,4 @@ entry:
}
!0 = !{!0}
+!1 = !{}
\ No newline at end of file
More information about the llvm-commits
mailing list