[llvm] [Inline][PGO] After inline, update InvokeInst profile counts in caller and cloned callee (PR #83809)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 16 13:30:43 PDT 2024


================
@@ -201,14 +201,23 @@ void scaleProfData(Instruction &I, uint64_t S, uint64_t T) {
                         !ProfDataName->getString().equals("VP")))
     return;
 
+  // If an instruction is a call and its branch weight has more than two
+  // operands, it represents taken vs not-taken branch probabilities and doesn't
+  // need scaling.
+  if (isa<CallBase>(&I) && ProfDataName->getString().equals("branch_weights") &&
----------------
minglotus-6 wrote:

As discussed added `hasCountTypeMD` in ProfDataUtils.cpp. PTAL, thanks!


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


More information about the llvm-commits mailing list