[llvm] r249802 - [SCEV] Call `StrengthenNoWrapFlags` after `GroupByComplexity`; NFCI

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 19:44:45 PDT 2015


Author: sanjoy
Date: Thu Oct  8 21:44:45 2015
New Revision: 249802

URL: http://llvm.org/viewvc/llvm-project?rev=249802&view=rev
Log:
[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`.

Modified:
    llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=249802&r1=249801&r2=249802&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Thu Oct  8 21:44:45 2015
@@ -1960,11 +1960,11 @@ const SCEV *ScalarEvolution::getAddExpr(
            "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<SCEVConstant>(Ops[0])) {
@@ -2368,11 +2368,11 @@ const SCEV *ScalarEvolution::getMulExpr(
            "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<SCEVConstant>(Ops[0])) {




More information about the llvm-commits mailing list