From dfccb77250a88cdf2bc1482c10de768cb875704d Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Thu, 20 Dec 2018 17:11:02 +0000 Subject: [PATCH] [InstCombine] Preserve access-group metadata. 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 | 2 +- test/Transforms/InstCombine/bitcast-store.ll | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index b9b1e7b6e8a..651e338bf47 100644 --- a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/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/test/Transforms/InstCombine/bitcast-store.ll b/test/Transforms/InstCombine/bitcast-store.ll index 6d795271755..2308d77be32 100644 --- a/test/Transforms/InstCombine/bitcast-store.ll +++ b/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 -- 2.50.1