summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
index cfdfa00e805..e57091340c0 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
@@ -319,6 +319,8 @@ static Instruction *combineLoadToOperationType(InstCombiner &IC, LoadInst &LI) {
Value *Ptr = LI.getPointerOperand();
unsigned AS = LI.getPointerAddressSpace();
+ AAMDNodes AAInfo;
+ LI.getAAMetadata(AAInfo);
// Fold away bit casts of the loaded value by loading the desired type.
if (LI.hasOneUse())
@@ -326,6 +328,7 @@ static Instruction *combineLoadToOperationType(InstCombiner &IC, LoadInst &LI) {
LoadInst *NewLoad = IC.Builder->CreateAlignedLoad(
IC.Builder->CreateBitCast(Ptr, BC->getDestTy()->getPointerTo(AS)),
LI.getAlignment(), LI.getName());
+ NewLoad->setAAMetadata(AAInfo);
BC->replaceAllUsesWith(NewLoad);
IC.EraseInstFromFunction(*BC);
return &LI;
OpenPOWER on IntegriCloud