[llvm] 46bff78 - [Coroutines] Remove alignment check in shouldBeMustTail

Jun Ma via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 6 18:08:15 PDT 2020


Author: Jun Ma
Date: 2020-04-07T09:07:34+08:00
New Revision: 46bff786bc0091f57d8d2ff2bca04191f37cd477

URL: https://github.com/llvm/llvm-project/commit/46bff786bc0091f57d8d2ff2bca04191f37cd477
DIFF: https://github.com/llvm/llvm-project/commit/46bff786bc0091f57d8d2ff2bca04191f37cd477.diff

LOG: [Coroutines] Remove alignment check in shouldBeMustTail

Differential Revision: https://reviews.llvm.org/D77362

Added: 
    

Modified: 
    llvm/lib/Transforms/Coroutines/CoroSplit.cpp
    llvm/test/Transforms/Coroutines/coro-split-musttail2.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
index 96c888d10d62..d7abc459edca 100644
--- a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
@@ -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))

diff  --git a/llvm/test/Transforms/Coroutines/coro-split-musttail2.ll b/llvm/test/Transforms/Coroutines/coro-split-musttail2.ll
index 2fa66c29b01b..ffc1c07bfe2f 100644
--- a/llvm/test/Transforms/Coroutines/coro-split-musttail2.ll
+++ b/llvm/test/Transforms/Coroutines/coro-split-musttail2.ll
@@ -8,7 +8,7 @@ entry:
   ret void;
 }
 
-define void @fakeresume2(i64*)  {
+define void @fakeresume2(i64* align 8)  {
 entry:
   ret void;
 }
@@ -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 [
@@ -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


        


More information about the llvm-commits mailing list