diff options
author | Chris Lattner <sabre@nondot.org> | 2007-11-23 08:46:22 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-11-23 08:46:22 +0000 |
commit | 42b5e08e7123aefbc6e93b547f44e3ed7604526f (patch) | |
tree | 936ae6f5f11aec67dc8a8aaeac29a383d84043de /lib/Analysis/ScalarEvolution.cpp | |
parent | eec8b9a7d6630d45985e72f5fa396b48ba490d68 (diff) |
Fix a bug where we'd try to find a scev value for a bitcast operand,
even though the bitcast operand did not have integer type. This fixes
PR1814.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44286 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | lib/Analysis/ScalarEvolution.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index cc6cde2ba2..1508fd0c52 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -1470,6 +1470,9 @@ static uint32_t GetMinTrailingZeros(SCEVHandle S) { /// Analyze the expression. /// SCEVHandle ScalarEvolutionsImpl::createSCEV(Value *V) { + if (!isa<IntegerType>(V->getType())) + return SE.getUnknown(V); + if (Instruction *I = dyn_cast<Instruction>(V)) { switch (I->getOpcode()) { case Instruction::Add: @@ -2076,6 +2079,11 @@ SCEVHandle ScalarEvolutionsImpl::getSCEVAtScope(SCEV *V, const Loop *L) { if (Constant *C = dyn_cast<Constant>(Op)) { Operands.push_back(C); } else { + // If any of the operands is non-constant and if they are + // non-integer, don't even try to analyze them with scev techniques. + if (!isa<IntegerType>(Op->getType())) + return V; + SCEVHandle OpV = getSCEVAtScope(getSCEV(Op), L); if (SCEVConstant *SC = dyn_cast<SCEVConstant>(OpV)) Operands.push_back(ConstantExpr::getIntegerCast(SC->getValue(), |