[llvm] [SimplifyIndVar] Push more users to worklist for simplifyUsers (PR #93598)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 05:40:04 PDT 2024


================
@@ -52,12 +52,11 @@ class IVVisitor {
 /// where the first entry indicates that the function makes changes and the
 /// second entry indicates that it introduced new opportunities for loop
 /// unswitching.
-std::pair<bool, bool> simplifyUsersOfIV(PHINode *CurrIV, ScalarEvolution *SE,
-                                        DominatorTree *DT, LoopInfo *LI,
-                                        const TargetTransformInfo *TTI,
-                                        SmallVectorImpl<WeakTrackingVH> &Dead,
-                                        SCEVExpander &Rewriter,
-                                        IVVisitor *V = nullptr);
+std::pair<bool, bool>
+simplifyUsersOfIV(PHINode *CurrIV, ScalarEvolution *SE, DominatorTree *DT,
+                  LoopInfo *LI, const TargetTransformInfo *TTI,
+                  SmallVectorImpl<WeakTrackingVH> &Dead, SCEVExpander &Rewriter,
+                  unsigned MaxDepthOutOfLoop = 1, IVVisitor *V = nullptr);
----------------
nikic wrote:

Okay, that makes sense. But as implemented, aren't you still calling this with the default of 1 from LoopUnroll? Shouldn't the default be 0 instead?

Could you please rebase over https://github.com/llvm/llvm-project/commit/6e3725d7f290d0180e8b5cfe073d0cc4c9bbafd0 so we at least don't have to pass through this parameter everywhere?

https://github.com/llvm/llvm-project/pull/93598


More information about the llvm-commits mailing list