mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
LSR ivchain bug fix: corner case with ConstantExpr.
Fixes PR11950. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153463 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d4e46a6316
commit
05fecbe42e
@ -704,8 +704,9 @@ static bool isHighCostExpansion(const SCEV *S,
|
||||
Value *UVal = U->getValue();
|
||||
for (Value::use_iterator UI = UVal->use_begin(), UE = UVal->use_end();
|
||||
UI != UE; ++UI) {
|
||||
Instruction *User = cast<Instruction>(*UI);
|
||||
if (User->getOpcode() == Instruction::Mul
|
||||
// If U is a constant, it may be used by a ConstantExpr.
|
||||
Instruction *User = dyn_cast<Instruction>(*UI);
|
||||
if (User && User->getOpcode() == Instruction::Mul
|
||||
&& SE.isSCEVable(User->getType())) {
|
||||
return SE.getSCEV(User) == Mul;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user