[PATCH] D107381: [runtimeunroll] Support multiple exits to latch exit w/epilogue loop

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 17 11:01:32 PDT 2021


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

LGTM



================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp:750
     // Split LatchExit to create phi nodes from branch above.
-    SmallVector<BasicBlock*, 4> Preds(predecessors(LatchExit));
+    SmallVector<BasicBlock*, 4> Preds({Latch});
     NewExit = SplitBlockPredecessors(LatchExit, Preds, ".unr-lcssa", DT, LI,
----------------
No need to create a SmallVector anymore here, you can directly pass `{Latch}`.


================
Comment at: llvm/test/Transforms/LoopUnroll/runtime-loop-multiple-exits.ll:2
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: -p
 ; RUN: opt < %s -loop-unroll -unroll-runtime=true -unroll-runtime-epilog=true -unroll-runtime-multi-exit=true -verify-loop-lcssa -verify-dom-info -verify-loop-info -S | FileCheck %s -check-prefixes=CHECK,EPILOG-NO-IC
 ; RUN: opt < %s -loop-unroll -unroll-runtime=true -unroll-runtime-epilog=true -unroll-runtime-multi-exit=true -verify-loop-lcssa -verify-dom-info -verify-loop-info -S | FileCheck %s -check-prefixes=CHECK,EPILOG
----------------
In https://github.com/llvm/llvm-project/commit/70ffd65ca97bd7010108ad8c1369c105fb78714a you dropped the `-instcombine` from the other RUN lines, so this `EPILOG-NO-IC` line is now redundant and can be dropped.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107381



More information about the llvm-commits mailing list