[PATCH] D114039: [runtime-unroll] Prune early exits when unrolling multiple exit loops

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 22 16:16:19 PST 2021


reames added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp:33
 #include "llvm/IR/Module.h"
+#include "llvm/IR/Verifier.h"
 #include "llvm/Support/CommandLine.h"
----------------
mkazantsev wrote:
> What's that needed for?
Stray change, will remove.


================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp:650
+    auto EC = SE->getExitCount(L, ExitingBB);
+    if (isa<SCEVCouldNotCompute>(EC) || !EC->getType()->isIntegerTy())
+      continue;
----------------
mkazantsev wrote:
> How can it be not integer type?
I believe we've fixed the case where we returned a pointer cmp, but I'm matching the existing code here because I don't remember the exact status of that.  


================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp:682
+    BECountSC = LatchEC;
+    TripCountSC = SE->getAddExpr(BECountSC, SE->getOne(BECountSC->getType()));
+    ExitingBlocksToPrune.clear();
----------------
mkazantsev wrote:
> What if it will overflow (BECountSC = UINT_MAX)?
Handled delicately in the existing code, behavior unchanged.  


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114039



More information about the llvm-commits mailing list