summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-05-07 19:23:21 +0000
committerDan Gohman <gohman@apple.com>2009-05-07 19:23:21 +0000
commit64f756b48c0cd3ef7d28ebfc26612b92cebf1b00 (patch)
treed7e37964b745e85ed11ef91ba68564912fbb695c /llvm/lib/Analysis
parent094bc31000279a139408e0a3a988010f5c5a918c (diff)
downloadbcm5719-llvm-64f756b48c0cd3ef7d28ebfc26612b92cebf1b00.tar.gz
bcm5719-llvm-64f756b48c0cd3ef7d28ebfc26612b92cebf1b00.zip
SCEVComplexityCompare's new code was missing SCEVUDivExpr. Implement
the SCEVUDivExpr case. llvm-svn: 71173
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp14
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);
OpenPOWER on IntegriCloud