diff options
author | Dan Gohman <gohman@apple.com> | 2009-04-16 22:35:57 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-04-16 22:35:57 +0000 |
commit | 84fc33ed920d55fe59544ec83f14d1abc5bf0d63 (patch) | |
tree | 46d5451c2d2d57fc5101b8af2b9c9d77f9911b44 /lib/Transforms/Scalar/LoopStrengthReduce.cpp | |
parent | d305e707a65fa18cbe828cae2338499661c9229e (diff) |
Use TargetData::getTypeSizeInBits instead of getPrimitiveSizeInBits()
to get the correct answer for pointer types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69321 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 733f37c207..3df0ab3594 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/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()); } |