[coroutine] should disable inline before calling coro split
authordongAxis <dongaxis@linux.alibaba.com>
Mon, 24 Aug 2020 14:22:08 +0000 (22:22 +0800)
committerdongAxis <dongaxis@linux.alibaba.com>
Mon, 24 Aug 2020 14:22:08 +0000 (22:22 +0800)
commit2e43acfed89b1903de473f682c65878bdebc395a
tree447211576f53b8c811d3941c323eff3bf92716f0
parent517caca359e027ba6e88b8531ef072084204cc2d
[coroutine] should disable inline before calling coro split
summary:
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

TestPlan: check-llvm

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D85812
llvm/include/llvm/Transforms/Coroutines.h
llvm/lib/Transforms/Coroutines/CoroInternal.h
llvm/lib/Transforms/IPO/AlwaysInliner.cpp
llvm/lib/Transforms/IPO/SampleProfile.cpp
llvm/test/Transforms/Coroutines/Inputs/sample.text.prof [new file with mode: 0644]
llvm/test/Transforms/Coroutines/coro-inline.ll [new file with mode: 0644]