summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-10-01 19:40:58 +0000
committerChris Lattner <sabre@nondot.org>2006-10-01 19:40:58 +0000
commit7d19067c425a8281e5495a1d4f392552abf855c8 (patch)
tree5a097827c2adfb7bd6355b6d26c7d7e5edd44f96 /llvm/lib/Transforms
parentc82477f3a84f7b12b090dd812003d9f0df609025 (diff)
downloadbcm5719-llvm-7d19067c425a8281e5495a1d4f392552abf855c8.tar.gz
bcm5719-llvm-7d19067c425a8281e5495a1d4f392552abf855c8.zip
Fix a bug from r1.391 of this file, where we checked the size instead of
the alignment when promoting allocations. This implements InstCombine/cast.ll:test32 llvm-svn: 30682
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 19051fa2e15..9bfd66afb29 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -5053,8 +5053,8 @@ Instruction *InstCombiner::PromoteCastOfAllocation(CastInst &CI,
const Type *CastElTy = PTy->getElementType();
if (!AllocElTy->isSized() || !CastElTy->isSized()) return 0;
- unsigned AllocElTyAlign = TD->getTypeSize(AllocElTy);
- unsigned CastElTyAlign = TD->getTypeSize(CastElTy);
+ unsigned AllocElTyAlign = TD->getTypeAlignment(AllocElTy);
+ unsigned CastElTyAlign = TD->getTypeAlignment(CastElTy);
if (CastElTyAlign < AllocElTyAlign) return 0;
// If the allocation has multiple uses, only promote it if we are strictly
OpenPOWER on IntegriCloud