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

Jin Huang via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 8 19:00:59 PDT 2026


================
@@ -1368,6 +1374,19 @@ 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 two branches as having equal weights because they are
+    // mutually exclusive.
+    if (SwitchIndex == 2) {
----------------
jinhuang1102 wrote:

Changed to uniform branch weights. Thx.

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


More information about the llvm-commits mailing list