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

Chad Rosier mcrosier at codeaurora.org
Fri Sep 12 11:08:52 PDT 2014


Thanks for the feedback, Phillip.

Andy,
I'll have to revisit the LSR code to better understand the the change.  At one point in time I understood what was going on, but it's since been paged out.  Assuming this patch gets accepted, I'll investigate the unsigned implementation.

 Chad

================
Comment at: lib/Transforms/Scalar/IndVarSimplify.cpp:935
@@ +934,3 @@
+  ICmpInst *Cmp = dyn_cast<ICmpInst>(DU.NarrowUse);
+  if (!Cmp || !Cmp->hasOneUse())
+    return false;
----------------
reames wrote:
> 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?
Exactly.  I'll remove the check and rerun the analysis.

================
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
 
----------------
reames wrote:
> 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.  
r217698.

http://reviews.llvm.org/D5333






More information about the llvm-commits mailing list