From a6b35e201f4588e3321a6e754357a571461687b3 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 7 May 2009 19:23:21 +0000 Subject: [PATCH] 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 --- lib/Analysis/ScalarEvolution.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 1a5ef7ef958..d34b898dbdf 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(LHS)) { + const SCEVUDivExpr *RC = cast(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(LHS)) { const SCEVCastExpr *RC = cast(RHS); -- 2.34.1