summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/VNCoercion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Utils/VNCoercion.cpp')
-rw-r--r--lib/Transforms/Utils/VNCoercion.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/VNCoercion.cpp b/lib/Transforms/Utils/VNCoercion.cpp
index a77bf50fe10b..591e1fd2dbee 100644
--- a/lib/Transforms/Utils/VNCoercion.cpp
+++ b/lib/Transforms/Utils/VNCoercion.cpp
@@ -431,7 +431,7 @@ Value *getLoadValueForLoad(LoadInst *SrcVal, unsigned Offset, Type *LoadTy,
PtrVal = Builder.CreateBitCast(PtrVal, DestPTy);
LoadInst *NewLoad = Builder.CreateLoad(DestTy, PtrVal);
NewLoad->takeName(SrcVal);
- NewLoad->setAlignment(SrcVal->getAlignment());
+ NewLoad->setAlignment(MaybeAlign(SrcVal->getAlignment()));
LLVM_DEBUG(dbgs() << "GVN WIDENED LOAD: " << *SrcVal << "\n");
LLVM_DEBUG(dbgs() << "TO: " << *NewLoad << "\n");