Skip to content

[SUA][Coroutines] Change LLVM's Coroutine lowering to allow for and use extra hash parameter to llvm.coro.id.retcon.once and llvm.coro.id.retcon #10015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions llvm/include/llvm/IR/Intrinsics.td
Original file line number Diff line number Diff line change
Expand Up @@ -1725,11 +1725,11 @@ def int_coro_id : DefaultAttrsIntrinsic<[llvm_token_ty],
NoCapture<ArgIndex<2>>]>;
def int_coro_id_retcon : Intrinsic<[llvm_token_ty],
[llvm_i32_ty, llvm_i32_ty, llvm_ptr_ty,
llvm_ptr_ty, llvm_ptr_ty, llvm_ptr_ty],
llvm_ptr_ty, llvm_ptr_ty, llvm_ptr_ty, llvm_vararg_ty],
[]>;
def int_coro_id_retcon_once : Intrinsic<[llvm_token_ty],
[llvm_i32_ty, llvm_i32_ty, llvm_ptr_ty,
llvm_ptr_ty, llvm_ptr_ty, llvm_ptr_ty],
llvm_ptr_ty, llvm_ptr_ty, llvm_ptr_ty, llvm_vararg_ty],
[]>;
def int_coro_alloc : Intrinsic<[llvm_i1_ty], [llvm_token_ty], []>;
def int_coro_id_async : Intrinsic<[llvm_token_ty],
Expand Down
15 changes: 14 additions & 1 deletion llvm/include/llvm/Transforms/Coroutines/CoroInstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class CoroIdInst : public AnyCoroIdInst {
/// This represents either the llvm.coro.id.retcon or
/// llvm.coro.id.retcon.once instruction.
class AnyCoroIdRetconInst : public AnyCoroIdInst {
enum { SizeArg, AlignArg, StorageArg, PrototypeArg, AllocArg, DeallocArg };
enum { SizeArg, AlignArg, StorageArg, PrototypeArg, AllocArg, DeallocArg, TypeIdArg };

public:
void checkWellFormed() const;
Expand Down Expand Up @@ -266,6 +266,19 @@ class AnyCoroIdRetconInst : public AnyCoroIdInst {
return cast<Function>(getArgOperand(DeallocArg)->stripPointerCasts());
}

/// Return the TypeId to be used for allocating typed memory
ConstantInt *getTypeId() const {
if (arg_size() <= TypeIdArg)
return nullptr;
assert(hasTypeId() && "Invalid number of arguments");
return cast<ConstantInt>(getArgOperand(TypeIdArg));
}

/// Return true if TypeId is present in the list of arguments, false otherwise
bool hasTypeId() const {
return arg_size() == TypeIdArg + 1;
}

// Methods to support type inquiry through isa, cast, and dyn_cast:
static bool classof(const IntrinsicInst *I) {
auto ID = I->getIntrinsicID();
Expand Down
1 change: 1 addition & 0 deletions llvm/include/llvm/Transforms/Coroutines/CoroShape.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ struct Shape {
Function *Dealloc;
BasicBlock *ReturnBlock;
bool IsFrameInlineInStorage;
ConstantInt* TypeId;
};

struct AsyncLoweringStorage {
Expand Down
19 changes: 15 additions & 4 deletions llvm/lib/Transforms/Coroutines/Coroutines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ void coro::Shape::analyze(Function &F,
RetconLowering.Dealloc = ContinuationId->getDeallocFunction();
RetconLowering.ReturnBlock = nullptr;
RetconLowering.IsFrameInlineInStorage = false;
RetconLowering.TypeId = ContinuationId->getTypeId();
break;
}
default:
Expand Down Expand Up @@ -513,7 +514,12 @@ Value *coro::Shape::emitAlloc(IRBuilder<> &Builder, Value *Size,
Size = Builder.CreateIntCast(Size,
Alloc->getFunctionType()->getParamType(0),
/*is signed*/ false);
auto *Call = Builder.CreateCall(Alloc, Size);
ConstantInt* TypeId = RetconLowering.TypeId;
CallInst *Call;
if (TypeId == nullptr)
Call = Builder.CreateCall(Alloc, Size);
else
Call = Builder.CreateCall(Alloc, {Size, TypeId});
propagateCallAttrsFromCallee(Call, Alloc);
addCallToCallGraph(CG, Call, Alloc);
return Call;
Expand Down Expand Up @@ -606,9 +612,14 @@ static void checkWFAlloc(const Instruction *I, Value *V) {
if (!FT->getReturnType()->isPointerTy())
fail(I, "llvm.coro.* allocator must return a pointer", F);

if (FT->getNumParams() != 1 ||
!FT->getParamType(0)->isIntegerTy())
fail(I, "llvm.coro.* allocator must take integer as only param", F);
if (FT->getNumParams() > 2 || FT->getNumParams() == 0)
fail(I, "llvm.coro.* allocator must take either one or two params", F);

if (FT->getNumParams() == 1 && !FT->getParamType(0)->isIntegerTy())
fail(I, "llvm.coro.* allocator must take integer as its first param", F);

if (FT->getNumParams() == 2 && !FT->getParamType(1)->isIntegerTy())
fail(I, "llvm.coro.* allocator must take uint64_t as its second param", F);
}

/// Check that the given value is a well-formed deallocator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ define {ptr, ptr, i32} @f(ptr %buffer, i32 %n, { i32 } %dummy) {
; CHECK-NEXT: ret { ptr, ptr, i32 } [[TMP2]]
;
entry:
%id = call token @llvm.coro.id.retcon(i32 1024, i32 8, ptr %buffer, ptr @prototype_f, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon(i32 1024, i32 8, ptr %buffer, ptr @prototype_f, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
br label %loop

Expand Down Expand Up @@ -51,7 +51,7 @@ define {ptr, i32} @g(ptr %buffer, i32 %n) {
; CHECK-NEXT: ret { ptr, i32 } [[TMP2]]
;
entry:
%id = call token @llvm.coro.id.retcon(i32 1024, i32 8, ptr %buffer, ptr @prototype_g, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon(i32 1024, i32 8, ptr %buffer, ptr @prototype_g, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
br label %loop

Expand All @@ -73,7 +73,7 @@ cleanup:
unreachable
}

declare token @llvm.coro.id.retcon(i32, i32, ptr, ptr, ptr, ptr)
declare token @llvm.coro.id.retcon(i32, i32, ptr, ptr, ptr, ptr, ...)
declare ptr @llvm.coro.begin(token, ptr)
declare i1 @llvm.coro.suspend.retcon.i1(...)
declare void @llvm.coro.suspend.retcon.isVoid(...)
Expand Down
14 changes: 7 additions & 7 deletions llvm/test/Transforms/Coroutines/coro-retcon-alloca.ll
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ define {ptr, ptr, i32} @f(ptr %buffer, i32 %n) {
; CHECK-NEXT: ret { ptr, ptr, i32 } [[TMP2]]
;
entry:
%id = call token @llvm.coro.id.retcon(i32 1024, i32 8, ptr %buffer, ptr @prototype_f, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon(i32 1024, i32 8, ptr %buffer, ptr @prototype_f, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
br label %loop

Expand Down Expand Up @@ -51,7 +51,7 @@ define {ptr, i32} @g(ptr %buffer, i32 %n) {
; CHECK-NEXT: ret { ptr, i32 } [[TMP2]]
;
entry:
%id = call token @llvm.coro.id.retcon(i32 1024, i32 8, ptr %buffer, ptr @prototype_g, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon(i32 1024, i32 8, ptr %buffer, ptr @prototype_g, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
br label %loop

Expand Down Expand Up @@ -84,7 +84,7 @@ define {ptr, i32} @h(ptr %buffer, i32 %n) {
; CHECK-NEXT: ret { ptr, i32 } [[TMP0]]
;
entry:
%id = call token @llvm.coro.id.retcon(i32 1024, i32 8, ptr %buffer, ptr @prototype_h, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon(i32 1024, i32 8, ptr %buffer, ptr @prototype_h, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
br label %loop

Expand Down Expand Up @@ -117,7 +117,7 @@ define {ptr, i32} @i(ptr %buffer, i32 %n) {
; CHECK-NEXT: ret { ptr, i32 } [[TMP0]]
;
entry:
%id = call token @llvm.coro.id.retcon(i32 1024, i32 8, ptr %buffer, ptr @prototype_i, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon(i32 1024, i32 8, ptr %buffer, ptr @prototype_i, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
br label %loop

Expand Down Expand Up @@ -149,7 +149,7 @@ define {ptr, i32} @j(ptr %buffer, i32 %n) {
; CHECK-NEXT: ret { ptr, i32 } [[TMP0]]
;
entry:
%id = call token @llvm.coro.id.retcon(i32 1024, i32 8, ptr %buffer, ptr @prototype_j, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon(i32 1024, i32 8, ptr %buffer, ptr @prototype_j, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
br label %forward

Expand Down Expand Up @@ -190,7 +190,7 @@ define {ptr, i32} @k(ptr %buffer, i32 %n, i1 %cond) {
; CHECK-NEXT: br label [[CORO_RETURN]]
;
entry:
%id = call token @llvm.coro.id.retcon(i32 1024, i32 8, ptr %buffer, ptr @prototype_g, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon(i32 1024, i32 8, ptr %buffer, ptr @prototype_g, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
br i1 %cond, label %alloca_block, label %non_alloca_block

Expand Down Expand Up @@ -221,7 +221,7 @@ cleanup:
unreachable
}

declare token @llvm.coro.id.retcon(i32, i32, ptr, ptr, ptr, ptr)
declare token @llvm.coro.id.retcon(i32, i32, ptr, ptr, ptr, ptr, ...)
declare ptr @llvm.coro.begin(token, ptr)
declare i1 @llvm.coro.suspend.retcon.i1(...)
declare void @llvm.coro.suspend.retcon.isVoid(...)
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/Transforms/Coroutines/coro-retcon-frame.ll
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ entry:
store i64 0, ptr %proj.1, align 8
store i64 0, ptr %proj.2, align 8
%escape_addr = ptrtoint ptr %tmp to i64
%id = call token @llvm.coro.id.retcon.once(i32 32, i32 8, ptr %buffer, ptr @prototype_f, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon.once(i32 32, i32 8, ptr %buffer, ptr @prototype_f, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
%proj.2.2 = getelementptr inbounds { i64, i64 }, ptr %tmp, i64 0, i32 1
call void @init(ptr %proj.1)
Expand Down Expand Up @@ -49,7 +49,7 @@ end:
; CHECK: resume:
; CHECK: call void @use(ptr %0)

declare token @llvm.coro.id.retcon.once(i32, i32, ptr, ptr, ptr, ptr)
declare token @llvm.coro.id.retcon.once(i32, i32, ptr, ptr, ptr, ptr, ...)
declare ptr @llvm.coro.begin(token, ptr)
declare i1 @llvm.coro.suspend.retcon.i1(...)
declare i1 @llvm.coro.end(ptr, i1, token)
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/Transforms/Coroutines/coro-retcon-once-private.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ target triple = "x86_64-apple-macosx10.12.0"

define internal {ptr, i32} @f(ptr %buffer, ptr %array) {
entry:
%id = call token @llvm.coro.id.retcon.once(i32 8, i32 8, ptr %buffer, ptr @prototype, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon.once(i32 8, i32 8, ptr %buffer, ptr @prototype, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
%load = load i32, ptr %array
%load.pos = icmp sgt i32 %load, 0
Expand All @@ -34,7 +34,7 @@ cleanup:
unreachable
}

declare token @llvm.coro.id.retcon.once(i32, i32, ptr, ptr, ptr, ptr)
declare token @llvm.coro.id.retcon.once(i32, i32, ptr, ptr, ptr, ptr, ...)
declare ptr @llvm.coro.begin(token, ptr)
declare i1 @llvm.coro.suspend.retcon.i1(...)
declare i1 @llvm.coro.end(ptr, i1, token)
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/Transforms/Coroutines/coro-retcon-once-value.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ target triple = "x86_64-apple-macosx10.12.0"

define {ptr, i32} @f(ptr %buffer, ptr %array) {
entry:
%id = call token @llvm.coro.id.retcon.once(i32 8, i32 8, ptr %buffer, ptr @prototype, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon.once(i32 8, i32 8, ptr %buffer, ptr @prototype, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
%load = load i32, ptr %array
%load.pos = icmp sgt i32 %load, 0
Expand Down Expand Up @@ -47,7 +47,7 @@ entry:

define {ptr, i32} @g(ptr %buffer, ptr %array, i32 %val) {
entry:
%id = call token @llvm.coro.id.retcon.once(i32 8, i32 8, ptr %buffer, ptr @prototype2, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon.once(i32 8, i32 8, ptr %buffer, ptr @prototype2, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
%load = load i32, ptr %array
%load.pos = icmp sgt i32 %load, 0
Expand Down Expand Up @@ -93,7 +93,7 @@ entry:
; Unfortunately, we don't seem to fully optimize this right now due
; to some sort of phase-ordering thing.

declare token @llvm.coro.id.retcon.once(i32, i32, ptr, ptr, ptr, ptr)
declare token @llvm.coro.id.retcon.once(i32, i32, ptr, ptr, ptr, ptr, ...)
declare ptr @llvm.coro.begin(token, ptr)
declare i1 @llvm.coro.suspend.retcon.i1(...)
declare i1 @llvm.coro.end(ptr, i1, token)
Expand Down
8 changes: 4 additions & 4 deletions llvm/test/Transforms/Coroutines/coro-retcon-once-value2.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ target triple = "x86_64-apple-macosx10.12.0"
define {ptr, ptr} @f(ptr %buffer, ptr %ptr) presplitcoroutine {
entry:
%temp = alloca i32, align 4
%id = call token @llvm.coro.id.retcon.once(i32 8, i32 8, ptr %buffer, ptr @prototype, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon.once(i32 8, i32 8, ptr %buffer, ptr @prototype, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
%oldvalue = load i32, ptr %ptr
store i32 %oldvalue, ptr %temp
Expand All @@ -27,7 +27,7 @@ cleanup:
define {ptr, ptr} @g(ptr %buffer, ptr %ptr, i8 %val) presplitcoroutine {
entry:
%temp = alloca i32, align 4
%id = call token @llvm.coro.id.retcon.once(i32 8, i32 8, ptr %buffer, ptr @prototype2, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon.once(i32 8, i32 8, ptr %buffer, ptr @prototype2, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
%oldvalue = load i32, ptr %ptr
store i32 %oldvalue, ptr %temp
Expand All @@ -49,7 +49,7 @@ cleanup:
define {ptr, ptr} @h(ptr %buffer, ptr %ptr) presplitcoroutine {
entry:
%temp = alloca i32, align 4
%id = call token @llvm.coro.id.retcon.once(i32 8, i32 8, ptr %buffer, ptr @prototype3, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon.once(i32 8, i32 8, ptr %buffer, ptr @prototype3, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
%oldvalue = load i32, ptr %ptr
store i32 %oldvalue, ptr %temp
Expand All @@ -68,7 +68,7 @@ cleanup:
}


declare token @llvm.coro.id.retcon.once(i32, i32, ptr, ptr, ptr, ptr)
declare token @llvm.coro.id.retcon.once(i32, i32, ptr, ptr, ptr, ptr, ...)
declare ptr @llvm.coro.begin(token, ptr)
declare i1 @llvm.coro.suspend.retcon.i1(...)
declare i1 @llvm.coro.end(ptr, i1, token)
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/Transforms/Coroutines/coro-retcon-opaque-ptr.ll
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ define ptr @f(ptr %buffer, i32 %n) {
; CHECK-NEXT: ret ptr @f.resume.0
;
entry:
%id = call token @llvm.coro.id.retcon(i32 8, i32 4, ptr %buffer, ptr @prototype, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon(i32 8, i32 4, ptr %buffer, ptr @prototype, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
br label %loop

Expand Down Expand Up @@ -60,7 +60,7 @@ define hidden { ptr, ptr } @g(ptr %buffer, ptr %ptr) {
; CHECK-NEXT: ret { ptr, ptr } [[TMP1]]
;
entry:
%id = call token @llvm.coro.id.retcon(i32 8, i32 4, ptr %buffer, ptr @g_prototype, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon(i32 8, i32 4, ptr %buffer, ptr @g_prototype, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
br label %loop

Expand All @@ -76,7 +76,7 @@ cleanup: ; preds = %loop
unreachable
}

declare token @llvm.coro.id.retcon(i32, i32, ptr, ptr, ptr, ptr)
declare token @llvm.coro.id.retcon(i32, i32, ptr, ptr, ptr, ptr, ...)
declare ptr @llvm.coro.begin(token, ptr)
declare i1 @llvm.coro.suspend.retcon.i1(...)
declare i1 @llvm.coro.end(ptr, i1, token)
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/Transforms/Coroutines/coro-retcon-remat.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

define { ptr, i32 } @f(ptr %buffer, i32 %n) {
entry:
%id = call token @llvm.coro.id.retcon(i32 8, i32 4, ptr %buffer, ptr @f_prototype, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon(i32 8, i32 4, ptr %buffer, ptr @f_prototype, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
br label %loop

Expand Down Expand Up @@ -35,7 +35,7 @@ cleanup:
unreachable
}

declare token @llvm.coro.id.retcon(i32, i32, ptr, ptr, ptr, ptr)
declare token @llvm.coro.id.retcon(i32, i32, ptr, ptr, ptr, ptr, ...)
declare ptr @llvm.coro.begin(token, ptr)
declare i1 @llvm.coro.suspend.retcon.i1(...)
declare i1 @llvm.coro.end(ptr, i1, token)
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/Transforms/Coroutines/coro-retcon-resume-values.ll
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ define ptr @f(ptr %buffer, i32 %n) {
; CHECK-NEXT: ret ptr @f.resume.0
;
entry:
%id = call token @llvm.coro.id.retcon(i32 8, i32 4, ptr %buffer, ptr @prototype, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon(i32 8, i32 4, ptr %buffer, ptr @prototype, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
br label %loop

Expand Down Expand Up @@ -63,7 +63,7 @@ entry:
; Unfortunately, we don't seem to fully optimize this right now due
; to some sort of phase-ordering thing.

declare token @llvm.coro.id.retcon(i32, i32, ptr, ptr, ptr, ptr)
declare token @llvm.coro.id.retcon(i32, i32, ptr, ptr, ptr, ptr, ...)
declare ptr @llvm.coro.begin(token, ptr)
declare { i32, i1 } @llvm.coro.suspend.retcon.sl_i32i1s(...)
declare i1 @llvm.coro.end(ptr, i1, token)
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/Transforms/Coroutines/coro-retcon-resume-values2.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

define ptr @f(ptr %buffer, i32 %n) presplitcoroutine {
entry:
%id = call token @llvm.coro.id.retcon(i32 8, i32 4, ptr %buffer, ptr @prototype, ptr @allocate, ptr @deallocate)
%id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon(i32 8, i32 4, ptr %buffer, ptr @prototype, ptr @allocate, ptr @deallocate)
%hdl = call ptr @llvm.coro.begin(token %id, ptr null)
%value0 = call i32 (...) @llvm.coro.suspend.retcon.i32()
%sum0 = call i32 @add(i32 %n, i32 %value0)
Expand All @@ -19,7 +19,7 @@ entry:
unreachable
}

declare token @llvm.coro.id.retcon(i32, i32, ptr, ptr, ptr, ptr)
declare token @llvm.coro.id.retcon(i32, i32, ptr, ptr, ptr, ptr, ...)
declare ptr @llvm.coro.begin(token, ptr)
declare i32 @llvm.coro.suspend.retcon.i32(...)
declare i1 @llvm.coro.end(ptr, i1, token)
Expand Down
Loading