[PATCH] [IndVarSimplify] Widen signed loop compare instructions to enable additional optimizations.

Philip Reames listmail at philipreames.com
Fri Sep 12 10:40:05 PDT 2014


Looks fine to me, though I'm not familiar with this code.  You should get a LGTM from someone who knows the area.  I'm mostly just reading through to build up my own background in the area.

================
Comment at: lib/Transforms/Scalar/IndVarSimplify.cpp:935
@@ +934,3 @@
+  ICmpInst *Cmp = dyn_cast<ICmpInst>(DU.NarrowUse);
+  if (!Cmp || !Cmp->hasOneUse())
+    return false;
----------------
mcrosier wrote:
> No that I think about it, I'm not sure the single use is necessary.
Why does it matter that the compare has one use?  We're not changing the result of the ICmp are we?

================
Comment at: test/Transforms/LoopSimplify/merge-exits.ll:1
@@ -1,4 +1,2 @@
-; RUN: opt < %s -loop-simplify -loop-rotate -instcombine -indvars -S -verify-loop-info -verify-dom-info > %t
-; RUN: not grep sext %t
-; RUN: grep "phi i64" %t | count 1
+; RUN: opt < %s -loop-simplify -loop-rotate -instcombine -indvars -S -verify-loop-info -verify-dom-info | FileCheck %s
 
----------------
mcrosier wrote:
> FileCheckize.
Separating this cleanup into it's own change before making the change required for your patch would make the diff a lot more understandable.

http://reviews.llvm.org/D5333






More information about the llvm-commits mailing list