llvm-project/llvm/test/Transforms/Coroutines
Xun Li 31e60b9133 [coroutine] should disable inline before calling coro split
This is a rework of D85812, which didn't land.
When callee coroutine function is inlined into caller coroutine function before coro-split pass, llvm will emits "coroutine should have exactly one defining @llvm.coro.begin". It seems that coro-early pass can not handle this quiet well.
So we believe that unsplited coroutine function should not be inlined.
This patch fix such issue by not inlining function if it has attribute "coroutine.presplit" (it means the function has not been splited) to fix this issue
test plan: check-llvm, check-clang

In D85812, there was suggestions on moving the macros to Attributes.td to avoid circular header dependency issue.
I believe it's not worth doing just to be able to use one constant string in one place.
Today, there are already 3 possible attribute values for "coroutine.presplit": c6543cc6b8/llvm/lib/Transforms/Coroutines/CoroInternal.h (L40-L42)
If we move them into Attributes.td, we would be adding 3 new attributes to EnumAttr, just to support this, which I think is an overkill.

Instead, I think the best way to do this is to add an API in Function class that checks whether this function is a coroutine, by checking the attribute by name directly.

Differential Revision: https://reviews.llvm.org/D92706
2020-12-08 08:53:08 -08:00
..
Inputs [coroutine] should disable inline before calling coro split 2020-12-08 08:53:08 -08:00
ArgAddr.ll Recommit "[DSE] Switch to MemorySSA-backed DSE by default." 2020-10-16 09:02:53 +01:00
coro-alloc-with-param-O0.ll
coro-alloc-with-param-O2.ll
coro-alloca-01.ll [Coroutine] Properly determine whether an alloca should live on the frame 2020-10-29 23:56:05 -07:00
coro-alloca-02.ll [Coroutine] Properly determine whether an alloca should live on the frame 2020-10-29 23:56:05 -07:00
coro-alloca-03.ll [Coroutine] Properly determine whether an alloca should live on the frame 2020-10-29 23:56:05 -07:00
coro-alloca-04.ll [Coroutine] Properly determine whether an alloca should live on the frame 2020-10-29 23:56:05 -07:00
coro-alloca-05.ll [Coroutine] Move all used local allocas to the .resume function 2020-11-09 17:24:49 -08:00
coro-alloca-06.ll [Coroutine] Allocas used by StoreInst does not always escape 2020-11-16 09:14:44 -08:00
coro-async.ll [coro] Async coroutines: Make sure we can handle control flow in suspend point dispatch function 2020-11-16 11:59:02 -08:00
coro-catchswitch-cleanuppad.ll [Coroutine] Split PHI Nodes in `cleanuppad` blocks in a way that obeys EH pad rules 2020-09-25 11:30:38 -07:00
coro-catchswitch.ll
coro-cleanup-lowering.ll
coro-cleanup.ll
coro-debug-frame-variable.ll [Coroutines] Add DW_OP_deref for transformed dbg.value intrinsic. 2020-12-07 10:24:44 +08:00
coro-debug.ll [Coroutines] Refactor/Rewrite Spill and Alloca processing 2020-10-10 22:21:34 -07:00
coro-early.ll
coro-eh-aware-edge-split-00.ll
coro-eh-aware-edge-split-01.ll
coro-eh-aware-edge-split-02.ll
coro-elide.ll [test][Coro][NewPM] Fix coro-elide.ll under NPM 2020-10-02 15:39:42 -07:00
coro-frame-arrayalloca.ll [Coroutines] Refactor/Rewrite Spill and Alloca processing 2020-10-10 22:21:34 -07:00
coro-frame-reuse-alloca-00.ll [Coroutines] Reuse storage for local variables with non-overlapping lifetimes 2020-09-28 15:48:00 +08:00
coro-frame-reuse-alloca-01.ll [Coroutines] Refactor/Rewrite Spill and Alloca processing 2020-10-10 22:21:34 -07:00
coro-frame-reuse-alloca-02.ll [Coroutines] Refactor/Rewrite Spill and Alloca processing 2020-10-10 22:21:34 -07:00
coro-frame-reuse-alloca-03.ll [Coroutines] Reuse storage for local variables with non-overlapping lifetimes 2020-09-28 15:48:00 +08:00
coro-frame-unreachable.ll
coro-frame.ll
coro-heap-elide.ll
coro-inline.ll [coroutine] should disable inline before calling coro split 2020-12-08 08:53:08 -08:00
coro-materialize.ll
coro-padding.ll
coro-param-copy.ll [Coroutine] Make dealing with alloca spills more robust 2020-09-08 10:59:13 -07:00
coro-retcon-alloca.ll [Coroutines][NewPM] Fix coroutine tests under new pass manager 2020-10-04 14:19:29 -07:00
coro-retcon-frame.ll [Coroutines] Refactor/Rewrite Spill and Alloca processing 2020-10-10 22:21:34 -07:00
coro-retcon-once-value.ll [Coroutines][NewPM] Fix coroutine tests under new pass manager 2020-10-04 14:19:29 -07:00
coro-retcon-once-value2.ll [Coroutines] Refactor/Rewrite Spill and Alloca processing 2020-10-10 22:21:34 -07:00
coro-retcon-resume-values.ll [Coroutines][NewPM] Fix coroutine tests under new pass manager 2020-10-04 14:19:29 -07:00
coro-retcon-resume-values2.ll
coro-retcon-value.ll [Coroutines][NewPM] Fix coroutine tests under new pass manager 2020-10-04 14:19:29 -07:00
coro-retcon.ll Recommit "[DSE] Switch to MemorySSA-backed DSE by default." 2020-10-16 09:02:53 +01:00
coro-spill-after-phi.ll
coro-spill-corobegin.ll
coro-spill-defs-before-corobegin.ll [Coroutine] Fix a bug where Coroutine incorrectly spills phi and invoke defs before CoroBegin 2020-09-17 08:13:07 -07:00
coro-split-00.ll
coro-split-01.ll
coro-split-02.ll
coro-split-alloc.ll
coro-split-dbg.ll
coro-split-eh-00.ll
coro-split-eh-01.ll
coro-split-hidden.ll
coro-split-musttail.ll
coro-split-musttail1.ll
coro-split-musttail2.ll
coro-split-musttail3.ll
coro-split-sink-lifetime-01.ll [Coroutines] Refactor/Rewrite Spill and Alloca processing 2020-10-10 22:21:34 -07:00
coro-split-sink-lifetime-02.ll [Coroutines] Refactor sinkLifetimeStartMarkers 2020-07-09 18:23:28 +08:00
coro-split-sink-lifetime-03.ll [Coroutines] Refactor/Rewrite Spill and Alloca processing 2020-10-10 22:21:34 -07:00
coro-split-sink-lifetime-04.ll [Coroutines] Refactor/Rewrite Spill and Alloca processing 2020-10-10 22:21:34 -07:00
coro-swifterror.ll [Coroutines][NewPM] Fix coroutine tests under new pass manager 2020-10-04 14:19:29 -07:00
ex0.ll
ex1.ll
ex2.ll
ex3.ll
ex4.ll
ex5.ll
no-suspend.ll
phi-coro-end.ll
restart-trigger.ll
smoketest.ll [NewPM] Pin tests with -debug-pass to legacy PM 2020-09-22 17:54:25 -07:00