[llvm] [SimplifyCFG][PGO] Reuse existing `setBranchWeights` (PR #160629)

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 30 10:22: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)},
----------------
MatzeB wrote:

I think this cast is unnecessary, now that you are no longer overloading `setBranchWeights`?

https://github.com/llvm/llvm-project/pull/160629


More information about the llvm-commits mailing list