[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 02:33:28 PDT 2024


================
@@ -942,11 +956,11 @@ void SimplifyIndvar::simplifyUsers(PHINode *CurrIV, IVVisitor *V) {
     if ((isa<PtrToIntInst>(UseInst)) || (isa<TruncInst>(UseInst)))
       for (Use &U : UseInst->uses()) {
         Instruction *User = cast<Instruction>(U.getUser());
-        if (replaceIVUserWithLoopInvariant(User))
+        if (DT->dominates(L->getHeader(), User->getParent()) &&
----------------
nikic wrote:

Why do we need this condition? Aren't you already checking it when pushing uses?

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


More information about the llvm-commits mailing list