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

Jin Huang via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 14 01:55:19 PDT 2026


================
@@ -182,6 +182,8 @@ void Lowerer::lowerCoroNoop(IntrinsicInst *II) {
         M.getDataLayout().getProgramAddressSpace(), "__NoopCoro_ResumeDestroy",
         &M);
     NoopFn->setCallingConv(CallingConv::Fast);
+    // Because this function is a noop, we can set its entry count to 0.
+    NoopFn->setEntryCount(0);
----------------
jinhuang1102 wrote:

Sorry for the delay! You are right that setting 0 was incorrect since `NoopFn` can be called at runtime. Because `NoopFn` is generated by this the pass, PGO has no profile count for it so marking it as `unknown` for avoiding the false warnings.

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


More information about the cfe-commits mailing list