Skip to content

Commit

Permalink
[Coroutines] Remove alignment check in shouldBeMustTail
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D77362
  • Loading branch information
junparser committed Apr 7, 2020
1 parent 3f13ee8 commit 46bff78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions llvm/lib/Transforms/Coroutines/CoroSplit.cpp
Expand Up @@ -1015,9 +1015,9 @@ static bool shouldBeMustTail(const CallInst &CI, const Function &F) {

// CI should not has any ABI-impacting function attributes.
static const Attribute::AttrKind ABIAttrs[] = {
Attribute::StructRet, Attribute::ByVal, Attribute::InAlloca,
Attribute::InReg, Attribute::Returned, Attribute::SwiftSelf,
Attribute::SwiftError, Attribute::Alignment};
Attribute::StructRet, Attribute::ByVal, Attribute::InAlloca,
Attribute::InReg, Attribute::Returned, Attribute::SwiftSelf,
Attribute::SwiftError};
AttributeList Attrs = CI.getAttributes();
for (auto AK : ABIAttrs)
if (Attrs.hasParamAttribute(0, AK))
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/Transforms/Coroutines/coro-split-musttail2.ll
Expand Up @@ -8,7 +8,7 @@ entry:
ret void;
}

define void @fakeresume2(i64*) {
define void @fakeresume2(i64* align 8) {
entry:
ret void;
}
Expand All @@ -29,7 +29,7 @@ entry:
]
await.ready:
%save2 = call token @llvm.coro.save(i8* null)
call fastcc void @fakeresume2(i64* null)
call fastcc void @fakeresume2(i64* align 8 null)

%suspend2 = call i8 @llvm.coro.suspend(token %save2, i1 false)
switch i8 %suspend2, label %exit [
Expand All @@ -47,7 +47,7 @@ exit:

; Verify that in the resume part resume call is marked with musttail.
; CHECK-LABEL: @g.resume(
; CHECK: musttail call fastcc void @fakeresume2(i64* null)
; CHECK: musttail call fastcc void @fakeresume2(i64* align 8 null)
; CHECK-NEXT: ret void

declare token @llvm.coro.id(i32, i8* readnone, i8* nocapture readonly, i8*) #1
Expand Down

0 comments on commit 46bff78

Please sign in to comment.