[clang] [llvm] [coro] Lower `llvm.coro.await.suspend.handle` to resume with tail call (PR #89751)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 04:36:07 PDT 2024


================
@@ -40,10 +38,8 @@ exit:
 
 ; Verify that in the resume part resume call is marked with musttail.
 ; CHECK-LABEL: @f.resume(
-; CHECK: %[[addr2:.+]] = call ptr @llvm.coro.subfn.addr(ptr null, i8 0)
-; NOPGO-NEXT: musttail call fastcc void %[[addr2]](ptr null)
-; PGO: call void @llvm.instrprof
----------------
zmodem wrote:

I looked into this, and I don't think my patch changes the situation for value profiling. PGO instrumentation is performed early. Before my patch it would see a call to `@llvm.coro.resume`, and now it will see `@llvm.coro.await.suspend.handle`. In neither case does it see the lowered indirect call to the resumed function, and so no `@llvm.instrprof.value.profile` call gets inserted. Supporting that would be a nice future improvement.

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


More information about the llvm-commits mailing list