[PATCH] D77362: [Coroutines] Remove alignment check in shouldBeMustTail

JunMa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 2 21:09:06 PDT 2020


junparser created this revision.
junparser added reviewers: modocache, rjmccall.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
junparser edited the summary of this revision.

Since align is ABI-affecting only in combination with byval, there is no need to check alignment attribute anymore in shouldBeMustTail.

TestPlan: check-llvm


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77362

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


Index: llvm/test/Transforms/Coroutines/coro-split-musttail2.ll
===================================================================
--- llvm/test/Transforms/Coroutines/coro-split-musttail2.ll
+++ llvm/test/Transforms/Coroutines/coro-split-musttail2.ll
@@ -8,7 +8,7 @@
   ret void;
 }
 
-define void @fakeresume2(i64*)  {
+define void @fakeresume2(i64* align 8)  {
 entry:
   ret void;
 }
@@ -29,7 +29,7 @@
   ]
 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 @@
 
 ; 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
Index: llvm/lib/Transforms/Coroutines/CoroSplit.cpp
===================================================================
--- llvm/lib/Transforms/Coroutines/CoroSplit.cpp
+++ llvm/lib/Transforms/Coroutines/CoroSplit.cpp
@@ -1015,9 +1015,9 @@
 
   // 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))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77362.254695.patch
Type: text/x-patch
Size: 1869 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200403/b1b01646/attachment-0001.bin>


More information about the llvm-commits mailing list