1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
llvm-mirror/lib/Transforms/IPO
Xun Li 6b5a85d5d6 [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
..
AlwaysInliner.cpp [coroutine] should disable inline before calling coro split 2020-12-08 08:53:08 -08:00
Annotation2Metadata.cpp Add pass to add !annotate metadata from @llvm.global.annotations. 2020-11-16 14:57:11 +00:00
ArgumentPromotion.cpp
Attributor.cpp [NFC] Reduce include files dependency. 2020-12-03 18:25:05 +03:00
AttributorAttributes.cpp [NFC] Reduce include files dependency. 2020-12-03 18:25:05 +03:00
BarrierNoopPass.cpp
BlockExtractor.cpp
CalledValuePropagation.cpp
CMakeLists.txt [CSSPGO] Infrastructure for context-sensitive Sample PGO and Inlining 2020-12-06 11:49:18 -08:00
ConstantMerge.cpp
CrossDSOCFI.cpp
DeadArgumentElimination.cpp
ElimAvailExtern.cpp
ExtractGV.cpp
ForceFunctionAttrs.cpp Revert "[IR] add fn attr for no_stack_protector; prevent inlining on mismatch" 2020-11-17 17:27:14 -08:00
FunctionAttrs.cpp [AA] Split up LocationSize::unknown() 2020-11-26 18:39:55 +01:00
FunctionImport.cpp
GlobalDCE.cpp
GlobalOpt.cpp
GlobalSplit.cpp
HotColdSplitting.cpp
InferFunctionAttrs.cpp
Inliner.cpp [NFC] Fix typo 2020-12-02 22:23:57 -08:00
InlineSimple.cpp
Internalize.cpp
IPO.cpp Revert "[IRSim][IROutliner] Adding the extraction basics for the IROutliner." 2020-11-27 19:55:57 -06:00
LoopExtractor.cpp
LowerTypeTests.cpp
MergeFunctions.cpp
OpenMPOpt.cpp [OpenMPIRBuilder] forward arguments as pointers to outlined function 2020-12-02 14:59:41 +01:00
PartialInlining.cpp
PassManagerBuilder.cpp [ConstraintElimination] Tweak placement in pipeline. 2020-12-07 19:08:40 +00:00
PruneEH.cpp
SampleContextTracker.cpp [IPO] Fix operator precedence warning. NFCI. 2020-12-07 18:23:54 +00:00
SampleProfile.cpp [CSSPGO] Infrastructure for context-sensitive Sample PGO and Inlining 2020-12-06 11:49:18 -08:00
SampleProfileProbe.cpp [CSSPGO] Pseudo probes for function calls. 2020-12-02 13:45:20 -08:00
SCCP.cpp
StripDeadPrototypes.cpp
StripSymbols.cpp
SyntheticCountsPropagation.cpp
ThinLTOBitcodeWriter.cpp
WholeProgramDevirt.cpp [NFC] Reduce include files dependency. 2020-12-03 18:25:05 +03:00