[PATCH] D97747: [LoopUnrollRuntime] Add option to unroll loops with at most a specified number of exit/exiting blocks.

Bardia Mahjour via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 3 08:39:05 PST 2021


bmahjour added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp:57
+             "when epilog is generated"));
+static cl::opt<bool> UnrollRuntimeEnableCutoffPoint(
+    "unroll-runtime-enable-cutoff-point", cl::init(false), cl::Hidden,
----------------
Whitney wrote:
> bmahjour wrote:
> > Whitney wrote:
> > > bmahjour wrote:
> > > > I think we can avoid this extra option by initializing the Cutoff to 0. Any number larger than 0 would mean a valid cutoff. (ie 0 means no cutoff enabled, 1 means no multi-exit, 2 means at most 2 exits, etc). It would also render `UnrollRuntimeMultiExit` obsolete, which can be replaced in this patch or a subsequent one.
> > > Why `UnrollRuntimeMultiExit` is obsolete? Do you mean the user of `UnrollRuntimeMultiExit` can put a very big number?
> > Yes. I suppose a value of say 10 would be big enough for most cases....the bigger the number of exiting blocks, the less likely it will be profitable to unroll.
> ok, I can put a review for that after this patch get landed.
> Yes. I suppose a value of say 10 would be big enough for most cases....the bigger the number of exiting blocks, the less likely it will be profitable to unroll.

...just to clarify this, as Michael pointed out my original intention was to have 0 mean no cutoff (ie any number of exit/exiting blocks are allowed)....but the same thing can effectively be achieved with a large value specified for the option. 


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