diff options
| author | Dan Gohman <gohman@apple.com> | 2009-06-19 23:03:46 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-06-19 23:03:46 +0000 |
| commit | 3d692c995e068bb3101e7bb1ebdaa3d3a87a397b (patch) | |
| tree | 4bc7892c5356a072e7f976c5f5c14ed99e6f654d /lib/Transforms | |
| parent | 4f25cfbf68a546010da73707896a2b799056fe65 (diff) | |
| download | external_llvm-3d692c995e068bb3101e7bb1ebdaa3d3a87a397b.zip external_llvm-3d692c995e068bb3101e7bb1ebdaa3d3a87a397b.tar.gz external_llvm-3d692c995e068bb3101e7bb1ebdaa3d3a87a397b.tar.bz2 | |
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
Diffstat (limited to 'lib/Transforms')
| -rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 0396667..dac7340 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -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; |
