[llvm] [SimplifyCFG][PGO] Reuse existing `setBranchWeights` (PR #160629)
Mircea Trofin via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 30 11:27:09 PDT 2025
================
@@ -672,7 +672,7 @@ CallBase &llvm::pgo::promoteIndirectCall(CallBase &CB, Function *DirectCallee,
createBranchWeights(CB.getContext(), Count, TotalCount - Count));
if (AttachProfToDirectCall)
- setBranchWeights(NewInst, {static_cast<uint32_t>(Count)},
+ setBranchWeights(NewInst, ArrayRef<uint32_t>{static_cast<uint32_t>(Count)},
----------------
mtrofin wrote:
Also, I think the right thing here is to fit, not to cast. @mingmingl-llvm.
https://github.com/llvm/llvm-project/pull/160629
More information about the llvm-commits
mailing list