diff options
author | Dan Gohman <gohman@apple.com> | 2009-05-07 19:23:21 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-05-07 19:23:21 +0000 |
commit | a6b35e201f4588e3321a6e754357a571461687b3 (patch) | |
tree | 31f30fe1c0eb6ad02d321cb1caabc92926698bca /lib/Analysis/ScalarEvolution.cpp | |
parent | 1978426a94e3d3b53f488ffc56516e6e87906a0b (diff) |
SCEVComplexityCompare's new code was missing SCEVUDivExpr. Implement
the SCEVUDivExpr case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71173 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | lib/Analysis/ScalarEvolution.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 1a5ef7ef95..d34b898dbd 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/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); |