================
@@ -183,6 +183,10 @@ void Lowerer::lowerCoroNoop(IntrinsicInst *II) {
FnTy, GlobalValue::LinkageTypes::InternalLinkage,
M.getDataLayout().getProgramAddressSpace(), "__NoopCoro_ResumeDestroy",
&M);
+
+ // Because this function is a noop, we can set its entry count to 1.
+ NoopFn->setEntryCount(1);
----------------
jinhuang1102 wrote:
Ah, thanks for comment.
I think setting the entry count here has no impact on code optimization. It is
going to fix the `Transforms/Coroutines/coro-noop.ll`. Because
`__NoopCoro_ResumeDestroy ` is a dummy function containing only a `ret void`
with no control flow or computation to optimize.
It is for formalness. Because `__NoopCoro_ResumeDestroy ` is generated during
`coro-cleanup`, it starts with no entry count metadata, causing the Profile
Verifier to fail the build.
Btw - I think setting the entry count back to `0` is better way to a dummy
function. Do you agree?
https://github.com/llvm/llvm-project/pull/184466
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits