[PATCH] D103561: [LoopUnroll] Reorder code to max dom tree update more obvious [nfc]

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 3 09:43:03 PDT 2021


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

I tried this change as well, so have some compile-time numbers for a similar implementation: https://llvm-compile-time-tracker.com/compare.php?from=90310dfff8fd17b0cabdee1fd72d675e5eb2aa78&to=efa3a5246dbf80fca8c79fb7fd9464ba56f51f86&stat=instructions Which shows that impact is minor, though not entirely free. I dropped the change at the time because I didn't find it particularly helpful for followup work (the code is easy to adjust for multiple exit folding).

That said, this LGTM and at least simplifies the code.



================
Comment at: llvm/lib/Transforms/Utils/LoopUnroll.cpp:739
+
+    if (ExitingBI) {
+    auto SetDest = [&](BasicBlock *Src, bool WillExit, bool ExitOnTrue) {
----------------
clang-format warning is legit, some extra indentation snuck in here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103561



More information about the llvm-commits mailing list