summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-04-16 22:35:57 +0000
committerDan Gohman <gohman@apple.com>2009-04-16 22:35:57 +0000
commitfec1d086e0e8ce89f9eb4ee0ffc8100e25c195c8 (patch)
tree81ca32237e5974523908811339b06029253c026a /llvm/lib
parent573b92468e838b183235e91eae9a4bb9541446ec (diff)
downloadbcm5719-llvm-fec1d086e0e8ce89f9eb4ee0ffc8100e25c195c8.tar.gz
bcm5719-llvm-fec1d086e0e8ce89f9eb4ee0ffc8100e25c195c8.zip
Use TargetData::getTypeSizeInBits instead of getPrimitiveSizeInBits()
to get the correct answer for pointer types. llvm-svn: 69321
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 733f37c2074..3df0ab35942 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -1868,14 +1868,14 @@ void LoopStrengthReduce::StrengthReduceStridedIVUsers(const SCEVHandle &Stride,
// it here.
if (!ReuseIV.Base->isZero()) {
SCEVHandle typedBase = ReuseIV.Base;
- if (RewriteExpr->getType()->getPrimitiveSizeInBits() !=
- ReuseIV.Base->getType()->getPrimitiveSizeInBits()) {
+ if (TD->getTypeSizeInBits(RewriteExpr->getType()) !=
+ TD->getTypeSizeInBits(ReuseIV.Base->getType())) {
// It's possible the original IV is a larger type than the new IV,
// in which case we have to truncate the Base. We checked in
// RequiresTypeConversion that this is valid.
- assert (RewriteExpr->getType()->getPrimitiveSizeInBits() <
- ReuseIV.Base->getType()->getPrimitiveSizeInBits() &&
- "Unexpected lengthening conversion!");
+ assert(TD->getTypeSizeInBits(RewriteExpr->getType()) <
+ TD->getTypeSizeInBits(ReuseIV.Base->getType()) &&
+ "Unexpected lengthening conversion!");
typedBase = SE->getTruncateExpr(ReuseIV.Base,
RewriteExpr->getType());
}
OpenPOWER on IntegriCloud