From: Sanjoy Das Date: Fri, 9 Oct 2015 02:44:45 +0000 (+0000) Subject: [SCEV] Call `StrengthenNoWrapFlags` after `GroupByComplexity`; NFCI X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7875288f55475c11f14ac962cbf20033f0700a53;p=oota-llvm.git [SCEV] Call `StrengthenNoWrapFlags` after `GroupByComplexity`; NFCI The current implementation of `StrengthenNoWrapFlags` is agnostic to the order of `Ops`, so this commit should not change anything semantic. An upcoming change will make `StrengthenNoWrapFlags` sensitive to the order of `Ops`. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249802 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 4181ee6446a..5843ed76fa2 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -1960,11 +1960,11 @@ const SCEV *ScalarEvolution::getAddExpr(SmallVectorImpl &Ops, "SCEVAddExpr operand types don't match!"); #endif - Flags = StrengthenNoWrapFlags(this, scAddExpr, Ops, Flags); - // Sort by complexity, this groups all similar expression types together. GroupByComplexity(Ops, &LI); + Flags = StrengthenNoWrapFlags(this, scAddExpr, Ops, Flags); + // If there are any constants, fold them together. unsigned Idx = 0; if (const SCEVConstant *LHSC = dyn_cast(Ops[0])) { @@ -2368,11 +2368,11 @@ const SCEV *ScalarEvolution::getMulExpr(SmallVectorImpl &Ops, "SCEVMulExpr operand types don't match!"); #endif - Flags = StrengthenNoWrapFlags(this, scMulExpr, Ops, Flags); - // Sort by complexity, this groups all similar expression types together. GroupByComplexity(Ops, &LI); + Flags = StrengthenNoWrapFlags(this, scMulExpr, Ops, Flags); + // If there are any constants, fold them together. unsigned Idx = 0; if (const SCEVConstant *LHSC = dyn_cast(Ops[0])) {