1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +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 [ArgumentPromotion]: Copy function metadata after promoting arguments 2020-09-10 13:08:57 -04:00
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 [BlockExtract][NewPM] Port -extract-blocks to NPM 2020-10-21 12:51:11 -07:00
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 [DAE] MarkLive in MarkValue(MaybeLive) if any use is live 2020-10-02 10:55:08 -07:00
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 Fix some clang-tidy bugprone-argument-comment issues 2020-09-19 20:41:25 -07:00
GlobalDCE.cpp
GlobalOpt.cpp [SVE]Clarify TypeSize comparisons in llvm/lib/Transforms 2020-10-23 09:15:17 +01:00
GlobalSplit.cpp
HotColdSplitting.cpp Revert "[PM/CC1] Add -f[no-]split-cold-code CC1 option to toggle splitting" 2020-10-19 12:31:14 +02:00
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 [LoopExtract][NewPM] Port -loop-extract to NPM 2020-10-13 22:55:42 -07:00
LowerTypeTests.cpp [AArch64] Add BTI to CFI jumptables. 2020-09-29 13:50:23 +02:00
MergeFunctions.cpp
OpenMPOpt.cpp [OpenMPIRBuilder] forward arguments as pointers to outlined function 2020-12-02 14:59:41 +01:00
PartialInlining.cpp [PartialInliner]: Handle code regions in a switch stmt cases 2020-11-02 14:32:45 -05:00
PassManagerBuilder.cpp [ConstraintElimination] Tweak placement in pipeline. 2020-12-07 19:08:40 +00:00
PruneEH.cpp [PruneEH][NFC] Use CallGraphUpdater in PruneEH 2020-09-14 14:43:19 -07:00
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 [NewPM] Port strip* passes to NPM 2020-09-15 18:25:12 -07:00
SyntheticCountsPropagation.cpp
ThinLTOBitcodeWriter.cpp
WholeProgramDevirt.cpp [NFC] Reduce include files dependency. 2020-12-03 18:25:05 +03:00