4 Commits

Author SHA1 Message Date
Wei Wang
86b95b0c40
[SampleProf] Handle coro wrapper function name canonicalization (#174881)
Fix an issue where `FunctionSamples::getCanonicalFnName` incorrectly
canonicalizes coro await suspense wrapper functions to collide with the
coro function itself. This causes the sample annotation to skip coro
function. Canonicalization strips everything comes after the first dot
(.), unless the function attribute
"sample-profile-suffix-elision-policy" is set to "selected", in which
case it strips after the known suffixes. The wrapper function name has
the suffix of ".__await_suspend_wrapper__" + await_kind. Add the
attribute to wrapper function so that the suffix is not stripped.
2026-01-08 13:55:24 -08:00
Yuanfang Chen
fcb7d76d65 [coroutine] add nomerge function attribute to llvm.coro.save
It is illegal to merge two `llvm.coro.save` calls unless their
`llvm.coro.suspend` users are also merged. Marks it "nomerge" for
the moment.

This reverts D129025.

Alternative to D129025, which affects other token type users like WinEH.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D129530
2022-07-12 10:39:38 -07:00
Chuanqi Xu
735e6c40b5 [Coroutines] Convert coroutine.presplit to enum attr
This is required by @nikic in https://reviews.llvm.org/D127383 to
decrease the cost to check whether a function is a coroutine and this
fixes a FIXME too.

Reviewed By: rjmccall, ezhulenev

Differential Revision: https://reviews.llvm.org/D127471
2022-06-14 14:23:46 +08:00
Chuanqi Xu
c75cedc237 [Coroutines] Set presplit attribute in Clang and mlir
This fixes bug49264.

Simply, coroutine shouldn't be inlined before CoroSplit. And the marker
for pre-splited coroutine is created in CoroEarly pass, which ran after
AlwaysInliner Pass in O0 pipeline. So that the AlwaysInliner couldn't
detect it shouldn't inline a coroutine. So here is the error.

This patch set the presplit attribute in clang and mlir. So the inliner
would always detect the attribute before splitting.

Reviewed By: rjmccall, ezhulenev

Differential Revision: https://reviews.llvm.org/D115790
2022-01-05 10:25:02 +08:00