[PATCH] D97747: [LoopUnrollRuntime] Add option to unroll loops with at most two exit/exiting blocks.

Bardia Mahjour via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 2 10:48:50 PST 2021


bmahjour added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp:508
+    return true;
+
   // The second heuristic is that L has one exit other than the latchexit and
----------------
Whitney wrote:
> bmahjour wrote:
> > IIUC this is basically trying to avoid the check for the "deoptimize" call on line 514, right? In that case can we just add this check to that line and update the comments on line 512 with something like: "//. When `UnrollRuntimeAtMostTwoExits` is specified we assume the other exit branch is predictable even if it has no deoptimize call//"?
> When `UnrollRuntimeAtMostTwoExits` is specified, we also allows `OtherExits.size()` == 0. 
I would have expected that when OtherExits is empty, we are not in a multi-exit-loop scenario so the result of this function won't matter...but I guess it's better to be cautious and explicitly handle that case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97747



More information about the llvm-commits mailing list