summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kruse <llvm@meinersbur.de>2018-12-20 17:11:02 +0000
committerMichael Kruse <llvm@meinersbur.de>2018-12-20 17:11:02 +0000
commit199427100bd090f7f5aa8615921813d7ab1c7f51 (patch)
tree8a88153b3014fb254fdcd276c1672a62002e4b34
parent18b008b5771bf5085268aec2ade92c315081200f (diff)
downloadbcm5719-llvm-199427100bd090f7f5aa8615921813d7ab1c7f51.tar.gz
bcm5719-llvm-199427100bd090f7f5aa8615921813d7ab1c7f51.zip
[InstCombine] Preserve access-group metadata.
Preserve llvm.access.group metadata when combining store instructions. This was forgotten in r349725. Fixes llvm.org/PR40117 llvm-svn: 349774
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp2
-rw-r--r--llvm/test/Transforms/InstCombine/bitcast-store.ll5
2 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
index b9b1e7b6e8a..651e338bf47 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
@@ -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:
diff --git a/llvm/test/Transforms/InstCombine/bitcast-store.ll b/llvm/test/Transforms/InstCombine/bitcast-store.ll
index 6d795271755..2308d77be32 100644
--- a/llvm/test/Transforms/InstCombine/bitcast-store.ll
+++ b/llvm/test/Transforms/InstCombine/bitcast-store.ll
@@ -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
OpenPOWER on IntegriCloud