mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-29 10:32:47 +00:00
Fix LSR's OptimizeSMax to ignore max operators with more than 2 operands,
which it isn't prepared to handle. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73787 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1e86a66b00
commit
4d1c1efd80
@ -2116,6 +2116,11 @@ ICmpInst *LoopStrengthReduce::OptimizeSMax(Loop *L, ICmpInst *Cond,
|
||||
const SCEVSMaxExpr *SMax = dyn_cast<SCEVSMaxExpr>(IterationCount);
|
||||
if (!SMax || SMax != SE->getSCEV(Sel)) return Cond;
|
||||
|
||||
// Two handle a max with more than two operands, this optimization would
|
||||
// require additional checking and setup.
|
||||
if (SMax->getNumOperands() != 2)
|
||||
return Cond;
|
||||
|
||||
SCEVHandle SMaxLHS = SMax->getOperand(0);
|
||||
SCEVHandle SMaxRHS = SMax->getOperand(1);
|
||||
if (!SMaxLHS || SMaxLHS != One) return Cond;
|
||||
|
Loading…
Reference in New Issue
Block a user