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

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 21 20:24:27 PST 2021


mkazantsev 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"
----------------
What's that needed for?


================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp:650
+    auto EC = SE->getExitCount(L, ExitingBB);
+    if (isa<SCEVCouldNotCompute>(EC) || !EC->getType()->isIntegerTy())
+      continue;
----------------
How can it be not integer type?


================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp:682
+    BECountSC = LatchEC;
+    TripCountSC = SE->getAddExpr(BECountSC, SE->getOne(BECountSC->getType()));
+    ExitingBlocksToPrune.clear();
----------------
What if it will overflow (BECountSC = UINT_MAX)?


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