[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 08:42:44 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
----------------
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//"?


================
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]]
----------------
how come it is still unrolled?


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