summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-10-21 05:45:41 +0000
committerChris Lattner <sabre@nondot.org>2005-10-21 05:45:41 +0000
commit5df0e36e98c96892700e19bd6225d9be5eae2ccf (patch)
treef2bf534fdc46e30ca52dad717326d9c83bd6195c
parentae5d9bd65b5f6c0f4d0cd2e19a4ea1b9ca24b82a (diff)
downloadbcm5719-llvm-5df0e36e98c96892700e19bd6225d9be5eae2ccf.tar.gz
bcm5719-llvm-5df0e36e98c96892700e19bd6225d9be5eae2ccf.zip
My previous patch was too conservative. Reject FP and void types, but do
allow pointer types. llvm-svn: 23859
-rw-r--r--llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 183362dc0e6..4f18637c9f6 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -372,7 +372,8 @@ static bool IVUseShouldUsePostIncValue(Instruction *User, Instruction *IV,
/// return true. Otherwise, return false.
bool LoopStrengthReduce::AddUsersIfInteresting(Instruction *I, Loop *L,
std::set<Instruction*> &Processed) {
- if (!I->getType()->isInteger()) return false;
+ if (!I->getType()->isInteger() && !isa<PointerType>(I->getType()))
+ return false; // Void and FP expressions cannot be reduced.
if (!Processed.insert(I).second)
return true; // Instruction already handled.
OpenPOWER on IntegriCloud