diff options
author | Chris Lattner <sabre@nondot.org> | 2005-03-06 22:52:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-03-06 22:52:29 +0000 |
commit | 8c79559443c9aa9144d4d565c90cc7508caafbc1 (patch) | |
tree | 42d5ffae066d74747558c625a8cbd6d521581293 /llvm/lib | |
parent | 2ce303b4061cb039c030ac416419c0c6b4475246 (diff) | |
download | bcm5719-llvm-8c79559443c9aa9144d4d565c90cc7508caafbc1.tar.gz bcm5719-llvm-8c79559443c9aa9144d4d565c90cc7508caafbc1.zip |
fix a bug where we thought arguments were constants :(
llvm-svn: 20506
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 95c1850089f..6c0290ae8c7 100644 --- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -154,15 +154,19 @@ void LoopStrengthReduce::strengthReduceGEP(GetElementPtrInst *GEPI, Loop *L, inc_op_vector.push_back(ConstantInt::get(Ty, 1)); indvar = op; break; - } else if (isa<Constant>(operand) || isa<Argument>(operand)) { + } else if (isa<Argument>(operand)) { + pre_op_vector.push_back(operand); + AllConstantOperands = false; + } else if (isa<Constant>(operand)) { pre_op_vector.push_back(operand); } else if (Instruction *inst = dyn_cast<Instruction>(operand)) { if (!DS->dominates(inst, Preheader->getTerminator())) return; pre_op_vector.push_back(operand); AllConstantOperands = false; - } else - return; + } else { + return; // Cannot handle this. + } Cache = Cache->get(operand); } assert(indvar > 0 && "Indvar used by GEP not found in operand list"); |