[PATCH] D131287: Fix branch weight in FoldCondBranchOnValueKnownInPredecessor pass in SimplifyCFG

Zhi Zhuang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 19 07:06:20 PDT 2022


LukeZhuang added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1099
 
+/// Keep halving the weights until the sum of weights can fit in uint32_t.
+static void FitTotalWeights(MutableArrayRef<uint64_t> Weights) {
----------------
RKSimon wrote:
> 'Keep halving' suggests there should be a while loop?
Oh, this function and comment is copied from the FitWeights above. Yeah I agree that it somewhat does not match with comments. I prefer to change comment to like "Fit weight so that ..."


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131287



More information about the llvm-commits mailing list