From: Dan Gohman Date: Sun, 29 Aug 2010 15:07:13 +0000 (+0000) Subject: Micro-optimize GroupByComplexity. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c6a8e99fb34f039d5e410409f21cc03802059e59;p=oota-llvm.git Micro-optimize GroupByComplexity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112431 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 176de3a2b9e..863f8a65409 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -704,8 +704,9 @@ static void GroupByComplexity(SmallVectorImpl &Ops, if (Ops.size() == 2) { // This is the common case, which also happens to be trivially simple. // Special case it. - if (SCEVComplexityCompare(LI)(Ops[1], Ops[0])) - std::swap(Ops[0], Ops[1]); + const SCEV *&LHS = Ops[0], *&RHS = Ops[1]; + if (SCEVComplexityCompare(LI)(RHS, LHS)) + std::swap(LHS, RHS); return; }