[PATCH] D12710: InstCombine: Preserve tbaa metadata when merging loads that are phi arguments

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 17 09:55:38 PDT 2015


reames added a subscriber: reames.

================
Comment at: lib/Transforms/InstCombine/InstCombinePHI.cpp:357
@@ +356,3 @@
+    LoadInst *LI = cast<LoadInst>(PN.getIncomingValue(i));
+    combineMetadata(FirstLI, LI, { LLVMContext::MD_tbaa });
+    Value *NewInVal = LI->getOperand(0);
----------------
On first look, this seems like it's the wrong approach.  You're mutating the metadata on an existing load to accumulate the intersection of all of the incoming loads.  It's not clear to me that we want to be killing the metadata on the input load.  


http://reviews.llvm.org/D12710





More information about the llvm-commits mailing list