aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-17 23:58:30 +0000
committerChris Lattner <sabre@nondot.org>2009-03-17 23:58:30 +0000
commitb7e64ac3acac46ed42b5d099d59af73bedabb6fc (patch)
treef0b4db3daf95465027fc9ca8613f09b9133b3f41 /lib/Transforms/Scalar/LoopStrengthReduce.cpp
parent152932b71c488a6522c541f847eb3081cffb3793 (diff)
LSR shouldn't ever try to hack on integer IV's larger than 64-bits. Right now
it is not APInt clean, but even when it is it needs to be evaluated carefully to determine whether it is actually profitable. This fixes a crash on PR3806 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67134 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopStrengthReduce.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 79512980a4..6401a4c36a 100644
--- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -592,6 +592,12 @@ bool LoopStrengthReduce::AddUsersIfInteresting(Instruction *I, Loop *L,
SmallPtrSet<Instruction*,16> &Processed) {
if (!I->getType()->isInteger() && !isa<PointerType>(I->getType()))
return false; // Void and FP expressions cannot be reduced.
+
+ // LSR is not APInt clean, do not touch integers bigger than 64-bits.
+ if (I->getType()->isInteger() &&
+ I->getType()->getPrimitiveSizeInBits() > 64)
+ return false;
+
if (!Processed.insert(I))
return true; // Instruction already handled.