[llvm] [profcheck][coro] Adding Branch weights PGO in Coroutines Passes (PR #184466)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 9 08:42:06 PDT 2026


================
@@ -1368,6 +1374,20 @@ static void rewritePHIsForCleanupPad(BasicBlock *CleanupPadBB,
     SwitchOnDispatch->addCase(SwitchConstant, CaseBB);
     SwitchIndex++;
   }
+
+  if (!ProfcheckDisableMetadataFixes) {
+    // Add branch weights to SwitchOnDispatch, where branches are unreachable by
+    // default. We mark all branches as having equal weights because they are
----------------
mtrofin wrote:

so all including the default have the same weight? wouldn't this be equivalent to marking `unknown`?

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


More information about the llvm-commits mailing list