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

Chuanqi Xu via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 14 22:53:22 PDT 2026


================
@@ -411,7 +420,9 @@ void coro::BaseCloner::handleFinalSuspend() {
   auto *Switch = cast<SwitchInst>(VMap[Shape.SwitchLowering.ResumeSwitch]);
   auto FinalCaseIt = std::prev(Switch->case_end());
   BasicBlock *ResumeBB = FinalCaseIt->getCaseSuccessor();
-  Switch->removeCase(FinalCaseIt);
+
+  SwitchInstProfUpdateWrapper SwitchWrapper(*Switch);
+  SwitchWrapper.removeCase(FinalCaseIt);
----------------
ChuanqiXu9 wrote:

Why?

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


More information about the llvm-commits mailing list