[PATCH] D97747: [LoopUnrollRuntime] Add option to unroll loops with at most two exit/exiting blocks.
Whitney Tsang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 2 09:52:46 PST 2021
Whitney 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
----------------
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.
================
Comment at: llvm/test/Transforms/LoopUnroll/runtime-loop-at-most-two-exits.ll:98
+; DISABLED-NEXT: br i1 [[CMP_1]], label [[FOR_EXIT2]], label [[FOR_BODY_1]]
+; DISABLED: for.body.1:
+; DISABLED-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 [[INDVARS_IV_NEXT]]
----------------
bmahjour wrote:
> how come it is still unrolled?
I should remove `-unroll-count=2`
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