SCEVComplexityCompare's new code was missing SCEVUDivExpr. Implement

the SCEVUDivExpr case.

llvm-svn: 71173
This commit is contained in:
Dan Gohman 2009-05-07 19:23:21 +00:00
parent 094bc31000
commit 64f756b48c
1 changed files with 14 additions and 0 deletions

View File

@ -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);