[PATCH] D83953: [HWLoops] Stop converting to a while loop when it would be unsafe to

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 01:12:22 PDT 2020


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

Nice and tidy fix, thanks!



================
Comment at: llvm/lib/CodeGen/HardwareLoops.cpp:406
+      cast<BranchInst>(BB->getTerminator())->isUnconditional()) {
+    auto *Predecessor = BB->getSinglePredecessor();
+    // If it's not safe to create a while loop then don't force it and create a
----------------
nit: I //think// we're supposed to just use auto when it's obvious what the type is, say when using a cast.


================
Comment at: llvm/lib/CodeGen/HardwareLoops.cpp:411
+        UseLoopGuard = false;
+    else {
+        BB = Predecessor;
----------------
nit: you don't need curly brackets for one liners.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83953/new/

https://reviews.llvm.org/D83953





More information about the llvm-commits mailing list