[PATCH] D29173: [LoopUnroll] Use addClonedBlockToLoopInfo to clone the top level loop (NFC)

Michael Kuperstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 14:44:51 PST 2017


mkuper added a comment.

Nice cleanup, thanks - addClonedBlockToLoopInfo() will indeed add the top-level itself, I didn't notice this when I wrote the patch.
But I think you still need to know whether you actually created a remainder loop, see inline comment.



================
Comment at: lib/Transforms/Utils/LoopUnrollRuntime.cpp:389
   }
-  if (NewLoop) {
+  if (Loop *NewLoop = NewLoops[L]) {
     // Add unroll disable metadata to disable future unrolling for this loop.
----------------
Are you sure you want to do this if NewLoops[L] is the parent loop? I think this code is meant to only disable unrolling on the remainder loop.


https://reviews.llvm.org/D29173





More information about the llvm-commits mailing list