[PATCH] D158642: LoopUnrollRuntime: Add weights to all branches

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 09:48:53 PDT 2023


mtrofin accepted this revision.
mtrofin added a comment.
This revision is now accepted and ready to land.

nits.



================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp:779
   // Branch to either remainder (extra iterations) loop or unrolling loop.
-  B.CreateCondBr(BranchVal, RemainderLoop, UnrollingLoop);
+  MDNode *BranchWeights = nullptr;
+  if (hasBranchWeightMD(*Latch->getTerminator())) {
----------------
should this logic be factored in a `getBranchWeights(Latch, Count)` - something like that?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158642



More information about the llvm-commits mailing list