[PATCH] D63917: [LoopPeel] Re-factor llvm::peelLoop method. NFC.

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 30 23:48:54 PDT 2019


skatkov marked 2 inline comments as done.
skatkov added inline comments.


================
Comment at: lib/Transforms/Utils/LoopUnrollPeel.cpp:390
+/// \param[out] ExitWeight The weight of the edge from Latch to Exit block.
+/// \param[out] CurHeaderWeight The # of time the header is executed.
+static void initBranchWeights(BasicBlock *Header, BranchInst *LatchBR,
----------------
fhahn wrote:
> Using weight in the description for ExitWeight and # of times for CurHeaderWeigth seems inconsistent? (Also in some comments)
Could you please elaborate a bit on this comment?
I did not change anything in the semantic, just moved the code in a separate functions.

So the weights still make sense...


================
Comment at: lib/Transforms/Utils/LoopUnrollPeel.cpp:397
+    return;
+  unsigned HeaderIdx = (LatchBR->getSuccessor(0) == Header ? 0 : 1);
+  ExitWeight = HeaderIdx ? TrueWeight : FalseWeight;
----------------
fhahn wrote:
> nit: no brackets required?
Sure, will remove before landing.


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

https://reviews.llvm.org/D63917





More information about the llvm-commits mailing list