diff options
Diffstat (limited to 'llvm/lib/Analysis')
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 14 | 
1 files changed, 14 insertions, 0 deletions
| diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 1a5ef7ef958..d34b898dbdf 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -502,6 +502,20 @@ namespace {          return LC->getNumOperands() < RC->getNumOperands();        } +      // Lexicographically compare udiv expressions. +      if (const SCEVUDivExpr *LC = dyn_cast<SCEVUDivExpr>(LHS)) { +        const SCEVUDivExpr *RC = cast<SCEVUDivExpr>(RHS); +        if (operator()(LC->getLHS(), RC->getLHS())) +          return true; +        if (operator()(RC->getLHS(), LC->getLHS())) +          return false; +        if (operator()(LC->getRHS(), RC->getRHS())) +          return true; +        if (operator()(RC->getRHS(), LC->getRHS())) +          return false; +        return false; +      } +        // Compare cast expressions by operand.        if (const SCEVCastExpr *LC = dyn_cast<SCEVCastExpr>(LHS)) {          const SCEVCastExpr *RC = cast<SCEVCastExpr>(RHS); | 

