diff --git a/lib/Transforms/Coroutines/CoroEarly.cpp b/lib/Transforms/Coroutines/CoroEarly.cpp index 1660e41ba83..0185f8de5fa 100644 --- a/lib/Transforms/Coroutines/CoroEarly.cpp +++ b/lib/Transforms/Coroutines/CoroEarly.cpp @@ -179,7 +179,6 @@ bool Lowerer::lowerEarlyIntrinsics(Function &F) { // with a coroutine attribute. if (auto *CII = cast(&I)) { if (CII->getInfo().isPreSplit()) { - F.addFnAttr(CORO_PRESPLIT_ATTR, UNPREPARED_FOR_SPLIT); setCannotDuplicate(CII); CII->setCoroutineSelf(); CoroId = cast(&I); diff --git a/test/Transforms/Coroutines/coro-debug-O2.ll b/test/Transforms/Coroutines/coro-debug-O2.ll index 0ab8cfe84ff..7777c94a282 100644 --- a/test/Transforms/Coroutines/coro-debug-O2.ll +++ b/test/Transforms/Coroutines/coro-debug-O2.ll @@ -9,7 +9,7 @@ ; CHECK: ![[PROMISEVAR_RESUME]] = !DILocalVariable(name: "__promise" %promise_type = type { i32, i32, double } -define void @f() !dbg !8 { +define void @f() "coroutine.presplit"="0" !dbg !8 { entry: %__promise = alloca %promise_type, align 8 %0 = bitcast %promise_type* %__promise to i8* diff --git a/test/Transforms/Coroutines/coro-debug-frame-variable.ll b/test/Transforms/Coroutines/coro-debug-frame-variable.ll index 433488bfdde..9dbda92ddce 100644 --- a/test/Transforms/Coroutines/coro-debug-frame-variable.ll +++ b/test/Transforms/Coroutines/coro-debug-frame-variable.ll @@ -63,7 +63,7 @@ ; CHECK: ![[IVAR_RESUME]] = !DILocalVariable(name: "i" ; CHECK: ![[JVAR_RESUME]] = !DILocalVariable(name: "j" ; CHECK: ![[JDBGLOC_RESUME]] = !DILocation(line: 32, column: 7, scope: ![[RESUME_SCOPE]]) -define void @f() { +define void @f() "coroutine.presplit"="0" { entry: %__promise = alloca i8, align 8 %i = alloca i32, align 4 diff --git a/test/Transforms/Coroutines/coro-split-01.ll b/test/Transforms/Coroutines/coro-split-01.ll index ca9faa566eb..04d8fbdc963 100644 --- a/test/Transforms/Coroutines/coro-split-01.ll +++ b/test/Transforms/Coroutines/coro-split-01.ll @@ -2,7 +2,7 @@ ; RUN: opt < %s -S -enable-coroutines -O2 | FileCheck %s ; RUN: opt < %s -S -enable-coroutines -passes='default' | FileCheck %s -define i8* @f() { +define i8* @f() "coroutine.presplit"="0" { entry: %id = call token @llvm.coro.id(i32 0, i8* null, i8* null, i8* null) %need.dyn.alloc = call i1 @llvm.coro.alloc(token %id) diff --git a/test/Transforms/Coroutines/coro-split-recursive.ll b/test/Transforms/Coroutines/coro-split-recursive.ll index 0b6909fe4e6..907ec1bbd2c 100644 --- a/test/Transforms/Coroutines/coro-split-recursive.ll +++ b/test/Transforms/Coroutines/coro-split-recursive.ll @@ -13,7 +13,7 @@ declare i8 @llvm.coro.suspend(token, i1) ; CHECK: call void @foo() ; CHECK-LABEL: define {{.*}}void @foo.destroy( -define void @foo() { +define void @foo() "coroutine.presplit"="0" { entry: %__promise = alloca i32, align 8 %0 = bitcast i32* %__promise to i8* diff --git a/test/Transforms/Coroutines/ex0.ll b/test/Transforms/Coroutines/ex0.ll index de5752387cf..9ca29fc2a38 100644 --- a/test/Transforms/Coroutines/ex0.ll +++ b/test/Transforms/Coroutines/ex0.ll @@ -2,7 +2,7 @@ ; RUN: opt < %s -enable-coroutines -O2 -preserve-alignment-assumptions-during-inlining=false -S | FileCheck %s ; RUN: opt < %s -enable-coroutines -aa-pipeline=basic-aa -passes='default' -preserve-alignment-assumptions-during-inlining=false -S | FileCheck %s -define i8* @f(i32 %n) { +define i8* @f(i32 %n) "coroutine.presplit"="0" { entry: %id = call token @llvm.coro.id(i32 0, i8* null, i8* null, i8* null) %size = call i32 @llvm.coro.size.i32() diff --git a/test/Transforms/Coroutines/ex1.ll b/test/Transforms/Coroutines/ex1.ll index 42f603865b6..13276ef3778 100644 --- a/test/Transforms/Coroutines/ex1.ll +++ b/test/Transforms/Coroutines/ex1.ll @@ -2,7 +2,7 @@ ; RUN: opt < %s -O2 -enable-coroutines -preserve-alignment-assumptions-during-inlining=false -S | FileCheck %s ; RUN: opt < %s -aa-pipeline=basic-aa -passes='default' -enable-coroutines -preserve-alignment-assumptions-during-inlining=false -S | FileCheck %s -define i8* @f(i32 %n) { +define i8* @f(i32 %n) "coroutine.presplit"="0" { entry: %id = call token @llvm.coro.id(i32 0, i8* null, i8* null, i8* null) %size = call i32 @llvm.coro.size.i32() diff --git a/test/Transforms/Coroutines/ex2.ll b/test/Transforms/Coroutines/ex2.ll index 584bc909a4e..5f4431a9fd0 100644 --- a/test/Transforms/Coroutines/ex2.ll +++ b/test/Transforms/Coroutines/ex2.ll @@ -2,7 +2,7 @@ ; RUN: opt < %s -O2 -enable-coroutines -S | FileCheck %s ; RUN: opt < %s -passes='default' -enable-coroutines -S | FileCheck %s -define i8* @f(i32 %n) { +define i8* @f(i32 %n) "coroutine.presplit"="0" { entry: %id = call token @llvm.coro.id(i32 0, i8* null, i8* null, i8* null) %need.dyn.alloc = call i1 @llvm.coro.alloc(token %id) diff --git a/test/Transforms/Coroutines/ex3.ll b/test/Transforms/Coroutines/ex3.ll index 85cf53fb576..a822a69ec89 100644 --- a/test/Transforms/Coroutines/ex3.ll +++ b/test/Transforms/Coroutines/ex3.ll @@ -2,7 +2,7 @@ ; RUN: opt < %s -O2 -enable-coroutines -S | FileCheck %s ; RUN: opt < %s -aa-pipeline=basic-aa -passes='default' -enable-coroutines -S | FileCheck %s -define i8* @f(i32 %n) { +define i8* @f(i32 %n) "coroutine.presplit"="0" { entry: %id = call token @llvm.coro.id(i32 0, i8* null, i8* null, i8* null) %size = call i32 @llvm.coro.size.i32() diff --git a/test/Transforms/Coroutines/ex4.ll b/test/Transforms/Coroutines/ex4.ll index e60bc2c691f..a519f4e9bd1 100644 --- a/test/Transforms/Coroutines/ex4.ll +++ b/test/Transforms/Coroutines/ex4.ll @@ -2,7 +2,7 @@ ; RUN: opt < %s -O2 -enable-coroutines -S | FileCheck %s ; RUN: opt < %s -passes='default' -enable-coroutines -S | FileCheck %s -define i8* @f(i32 %n) { +define i8* @f(i32 %n) "coroutine.presplit"="0" { entry: %promise = alloca i32 %pv = bitcast i32* %promise to i8* diff --git a/test/Transforms/Coroutines/ex5.ll b/test/Transforms/Coroutines/ex5.ll index dd566505ba8..2cab0ac90be 100644 --- a/test/Transforms/Coroutines/ex5.ll +++ b/test/Transforms/Coroutines/ex5.ll @@ -2,7 +2,7 @@ ; RUN: opt < %s -O2 -enable-coroutines -preserve-alignment-assumptions-during-inlining=false -S | FileCheck %s ; RUN: opt < %s -aa-pipeline=basic-aa -passes='default' -enable-coroutines -preserve-alignment-assumptions-during-inlining=false -S | FileCheck %s -define i8* @f(i32 %n) { +define i8* @f(i32 %n) "coroutine.presplit"="0" { entry: %id = call token @llvm.coro.id(i32 0, i8* null, i8* null, i8* null) %size = call i32 @llvm.coro.size.i32() diff --git a/test/Transforms/Coroutines/phi-coro-end.ll b/test/Transforms/Coroutines/phi-coro-end.ll index d7ee2f58adb..39a34102796 100644 --- a/test/Transforms/Coroutines/phi-coro-end.ll +++ b/test/Transforms/Coroutines/phi-coro-end.ll @@ -2,7 +2,7 @@ ; RUN: opt < %s -O2 -enable-coroutines -S | FileCheck %s ; RUN: opt < %s -aa-pipeline=basic-aa -passes='default' -enable-coroutines -S | FileCheck %s -define i8* @f(i32 %n) { +define i8* @f(i32 %n) "coroutine.presplit"="0" { entry: %id = call token @llvm.coro.id(i32 0, i8* null, i8* null, i8* null) %size = call i32 @llvm.coro.size.i32() diff --git a/test/Transforms/Coroutines/restart-trigger.ll b/test/Transforms/Coroutines/restart-trigger.ll index ca74f92fb89..8e510959dcb 100644 --- a/test/Transforms/Coroutines/restart-trigger.ll +++ b/test/Transforms/Coroutines/restart-trigger.ll @@ -12,7 +12,7 @@ ; CHECK: CoroSplit: Processing coroutine 'f' state: 0 ; CHECK-NEXT: CoroSplit: Processing coroutine 'f' state: 1 -define void @f() { +define void @f() "coroutine.presplit"="0" { %id = call token @llvm.coro.id(i32 0, i8* null, i8* null, i8* null) %size = call i32 @llvm.coro.size.i32() %alloc = call i8* @malloc(i32 %size)