[PATCH] D32261: [LoopUnroll] Don't try to unroll non-rotated loops

Michael Zolotukhin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 17:27:52 PDT 2017


mzolotukhin added inline comments.


================
Comment at: lib/Transforms/Utils/LoopUnroll.cpp:324-329
   if (!BI || BI->isUnconditional()) {
     // The loop-rotate pass can be helpful to avoid this in many cases.
     DEBUG(dbgs() <<
              "  Can't unroll; loop not terminated by a conditional branch.\n");
     return false;
   }
----------------
This check can probably be removed then.


================
Comment at: test/Transforms/LoopUnroll/not-rotated.ll:4
+
+define void @tinkywinky() {
+entry:
----------------
Could you please add a comment explaining what we're testing here?


================
Comment at: test/Transforms/LoopUnroll/not-rotated.ll:12
+body1:
+  br i1 true, label %body2, label %sink
+body2:
----------------
I'd prefer replacing `i1 true` with something like `i1 %a`, where `%a` is a function argument. That would make the test more stable against compiler getting smarter and optimizing these branches away in future.


https://reviews.llvm.org/D32261





More information about the llvm-commits mailing list