mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-13 23:18:51 +00:00
fix a bug where we thought arguments were constants :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20506 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3f93197098
commit
2f62fdc9a7
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user