[PATCH] D45874: [LoopUnroll] Split out simplify code after Unroll into a new function. NFC

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 20 08:00:29 PDT 2018


fhahn accepted this revision.
fhahn added a comment.
This revision is now accepted and ready to land.

I think this is a reasonable code movement to make things slightly more modular. LGTM, but please wait with committing till next week, so other people have a chance to chime in.



================
Comment at: lib/Transforms/Utils/LoopUnroll.cpp:255
 
+static void simplifyLoopAfterUnroll(Loop *L, bool SimplifyIVs, LoopInfo *LI,
+                                    ScalarEvolution *SE, DominatorTree *DT,
----------------
Could you add a comment here summarizing which simplifications are done here?


================
Comment at: lib/Transforms/Utils/LoopUnroll.cpp:822
 
-  // Simplify any new induction variables in the partially unrolled loop.
-  if (SE && !CompletelyUnroll && (Count > 1 || Peeled)) {
-    SmallVector<WeakTrackingVH, 16> DeadInsts;
-    simplifyLoopIVs(L, SE, DT, LI, DeadInsts);
-
-    // Aggressively clean up dead instructions that simplifyLoopIVs already
-    // identified. Any remaining should be cleaned up below.
-    while (!DeadInsts.empty())
-      if (Instruction *Inst =
-              dyn_cast_or_null<Instruction>(&*DeadInsts.pop_back_val()))
-        RecursivelyDeleteTriviallyDeadInstructions(Inst);
-  }
-
   // At this point, the code is well formed.  We now do a quick sweep over the
   // inserted code, doing constant propagation and dead code elimination as we
----------------
I think this comment is stale now


https://reviews.llvm.org/D45874





More information about the llvm-commits mailing list