[PATCH] D90421: [IndVarSimplify][LoopUtils] Move WidenIV to Utils. NFCI.
    Dave Green via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Nov  2 00:27:38 PST 2020
    
    
  
dmgreen added a comment.
Yeah, this sounds like it would be useful on it's own.
================
Comment at: llvm/include/llvm/Transforms/Utils/LoopUtils.h:463
+// the input to WidenIV.
+struct WideIVInfo {
+  PHINode *NarrowIV = nullptr;
----------------
Is it worth making this a member of WidenIV?  It is used in other places, but usually in conjunction with WidenIV I think.
================
Comment at: llvm/include/llvm/Transforms/Utils/LoopUtils.h:476
+/// pointers.
+struct NarrowIVDefUse {
+  Instruction *NarrowDef = nullptr;
----------------
This one seems to only be used WidenIV. Might as well make it a subclass.
================
Comment at: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:638
+      if (PHINode *WidePhi = Widener.createWideIV(Rewriter,
+                                                  UsePostIncrementRanges)) {
+        NumElimExt += Widener.getNumElimExt();
----------------
UsePostIncrementRanges could be set in the constructor of WidenIV. Or the option could be moved to LoopUtils?
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90421/new/
https://reviews.llvm.org/D90421
    
    
More information about the llvm-commits
mailing list