summaryrefslogtreecommitdiff
path: root/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-08 19:28:38 +0000
committerChris Lattner <sabre@nondot.org>2009-01-08 19:28:38 +0000
commit0f2831c820151aa6f2cd6a8bd7b6b633b1035524 (patch)
tree67f6ce72cac44f90ee4920fb6304a69d6e308f3f /lib/Analysis/ValueTracking.cpp
parent1e407c338f6944242facb1e0c32903162cc366f0 (diff)
downloadllvm-0f2831c820151aa6f2cd6a8bd7b6b633b1035524.tar.gz
llvm-0f2831c820151aa6f2cd6a8bd7b6b633b1035524.tar.bz2
llvm-0f2831c820151aa6f2cd6a8bd7b6b633b1035524.tar.xz
ValueTracker can't assume that an alloca with no specified alignment
will get its preferred alignment. It has to be careful and cautiously assume it will just get the ABI alignment. This prevents instcombine from rounding up the alignment of a load/store without adjusting the alignment of the alloca. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ValueTracking.cpp')
-rw-r--r--lib/Analysis/ValueTracking.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp
index c51a719313..b8aac9deb7 100644
--- a/lib/Analysis/ValueTracking.cpp
+++ b/lib/Analysis/ValueTracking.cpp
@@ -416,7 +416,7 @@ void llvm::ComputeMaskedBits(Value *V, const APInt &Mask,
unsigned Align = AI->getAlignment();
if (Align == 0 && TD) {
if (isa<AllocaInst>(AI))
- Align = TD->getPrefTypeAlignment(AI->getType()->getElementType());
+ Align = TD->getABITypeAlignment(AI->getType()->getElementType());
else if (isa<MallocInst>(AI)) {
// Malloc returns maximally aligned memory.
Align = TD->getABITypeAlignment(AI->getType()->getElementType());