[llvm] r241955 - [InstCombine] Actually combine AA metadata when replacing one load with another

Bjorn Steinbrink bsteinbr at gmail.com
Fri Jul 10 15:30:17 PDT 2015


Author: bsteinbr
Date: Fri Jul 10 17:30:17 2015
New Revision: 241955

URL: http://llvm.org/viewvc/llvm-project?rev=241955&view=rev
Log:
[InstCombine] Actually combine AA metadata when replacing one load with another

Fixes PR24083

Modified:
    llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
    llvm/trunk/test/Transforms/InstCombine/load-combine-metadata.ll

Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp?rev=241955&r1=241954&r2=241955&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp Fri Jul 10 17:30:17 2015
@@ -762,8 +762,6 @@ Instruction *InstCombiner::visitLoadInst
         LLVMContext::MD_nonnull,
       };
       combineMetadata(NLI, &LI, KnownIDs);
-      if (AATags)
-        NLI->setAAMetadata(AATags);
     };
 
     return ReplaceInstUsesWith(

Modified: llvm/trunk/test/Transforms/InstCombine/load-combine-metadata.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/load-combine-metadata.ll?rev=241955&r1=241954&r2=241955&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/load-combine-metadata.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/load-combine-metadata.ll Fri Jul 10 17:30:17 2015
@@ -3,17 +3,15 @@
 target datalayout = "e-m:e-p:64:64:64-i64:64-f80:128-n8:16:32:64-S128"
 
 ; CHECK-LABEL: @test_load_load_combine_metadata(
-; Check that range metadata is combined and AA metadata is preserved
+; Check that range and AA metadata is combined
 ; CHECK: %[[V:.*]] = load i32, i32* %0
 ; CHECK-SAME: !tbaa !{{[0-9]+}}
 ; CHECK-SAME: !range ![[RANGE:[0-9]+]]
-; CHECK-SAME: !alias.scope !{{[0-9]+}}
-; CHECK-SAME: !noalias !{{[0-9]+}}
 ; CHECK: store i32 %[[V]], i32* %1
 ; CHECK: store i32 %[[V]], i32* %2
 define void @test_load_load_combine_metadata(i32*, i32*, i32*) {
   %a = load i32, i32* %0, !tbaa !8, !range !0, !alias.scope !5, !noalias !6
-  %b = load i32, i32* %0, !range !1
+  %b = load i32, i32* %0, !tbaa !8, !range !1
   store i32 %a, i32* %1
   store i32 %b, i32* %2
   ret void





More information about the llvm-commits mailing list