mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 23:24:34 +00:00
Handle a corner case with IV chain collection with bailout instead of assert.
Fixes PR11783: bad cast to AddRecExpr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148572 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -2484,11 +2484,15 @@ void LSRInstance::ChainInstruction(Instruction *UserInst, Instruction *IVOper,
|
||||
DEBUG(dbgs() << "IV Chain Limit\n");
|
||||
return;
|
||||
}
|
||||
LastIncExpr = SE.getSCEV(NextIV);
|
||||
// IVUsers may have skipped over sign/zero extensions. We don't currently
|
||||
// attempt to form chains involving extensions unless they can be hoisted
|
||||
// into this loop's AddRec.
|
||||
if (!isa<SCEVAddRecExpr>(LastIncExpr))
|
||||
return;
|
||||
++NChains;
|
||||
IVChainVec.resize(NChains);
|
||||
ChainUsersVec.resize(NChains);
|
||||
LastIncExpr = SE.getSCEV(NextIV);
|
||||
assert(isa<SCEVAddRecExpr>(LastIncExpr) && "expect recurrence at IV user");
|
||||
DEBUG(dbgs() << "IV Head: (" << *UserInst << ") IV=" << *LastIncExpr
|
||||
<< "\n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user