summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorGor Nishanov <GorNishanov@gmail.com>2017-08-23 14:47:52 +0000
committerGor Nishanov <GorNishanov@gmail.com>2017-08-23 14:47:52 +0000
commit2f55b958b1ad6f224a8cf65d6b640b8fbff78595 (patch)
tree6d02d695e65c4ab9079cbfbad2938a70797b35cd /llvm/lib
parent6c75b51bb57fc329fbaea61fe8f37d50fd81829f (diff)
downloadbcm5719-llvm-2f55b958b1ad6f224a8cf65d6b640b8fbff78595.tar.gz
bcm5719-llvm-2f55b958b1ad6f224a8cf65d6b640b8fbff78595.zip
[coroutines] CoroBegin from inner coroutines should be considered for spills
Summary: If a coroutine outer calls another coroutine inner and the inner coroutine body is inlined into the outer, coro.begin from the inner coroutine should be considered for spilling if accessed across suspends. Prior to this change, coroutine frame building code was not considering any coro.begins for spilling. With this change, we only ignore coro.begin for the current coroutine, but, any coro.begins that were inlined into the current coroutine are eligible for spills. Fixes PR34267 Reviewers: GorNishanov Subscribers: qcolombet, llvm-commits, EricWF Differential Revision: https://reviews.llvm.org/D37062 llvm-svn: 311556
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Coroutines/CoroFrame.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp
index 85e9003ec3c..d192fa699f3 100644
--- a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp
@@ -673,8 +673,8 @@ static bool materializable(Instruction &V) {
// Check for structural coroutine intrinsics that should not be spilled into
// the coroutine frame.
static bool isCoroutineStructureIntrinsic(Instruction &I) {
- return isa<CoroIdInst>(&I) || isa<CoroBeginInst>(&I) ||
- isa<CoroSaveInst>(&I) || isa<CoroSuspendInst>(&I);
+ return isa<CoroIdInst>(&I) || isa<CoroSaveInst>(&I) ||
+ isa<CoroSuspendInst>(&I);
}
// For every use of the value that is across suspend point, recreate that value
@@ -839,7 +839,7 @@ void coro::buildCoroutineFrame(Function &F, Shape &Shape) {
for (Instruction &I : instructions(F)) {
// Values returned from coroutine structure intrinsics should not be part
// of the Coroutine Frame.
- if (isCoroutineStructureIntrinsic(I))
+ if (isCoroutineStructureIntrinsic(I) || &I == Shape.CoroBegin)
continue;
// The Coroutine Promise always included into coroutine frame, no need to
// check for suspend crossing.
OpenPOWER on IntegriCloud