]> granicus.if.org Git - llvm/commitdiff
[InstCombine] Preserve access-group metadata.
authorMichael Kruse <llvm@meinersbur.de>
Thu, 20 Dec 2018 17:11:02 +0000 (17:11 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Thu, 20 Dec 2018 17:11:02 +0000 (17:11 +0000)
Preserve llvm.access.group metadata when combining store instructions.
This was forgotten in r349725.

Fixes llvm.org/PR40117

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349774 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
test/Transforms/InstCombine/bitcast-store.ll

index b9b1e7b6e8aec1b1678fd83c2ad680bb069843a1..651e338bf47142fa34224c1b53b8c69653835167 100644 (file)
@@ -553,10 +553,10 @@ static StoreInst *combineStoreToNewValue(InstCombiner &IC, StoreInst &SI, Value
     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:
index 6d7952717550c67b5c13a7a20e40b7fe281006cc..2308d77be32ca5c6d5cb57b2e6c7e6d8b8d8f5e7 100644 (file)
@@ -10,11 +10,11 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
 @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