[llvm] [ARM] Expose supportsTailCalls in ARMTargetTransformInfo (PR #67932)

Matthew Mirvish via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 1 12:53:27 PDT 2023


https://github.com/mincrmatt12 updated https://github.com/llvm/llvm-project/pull/67932

>From b2bced0d955e83f87df39fdcedb98adf061087e6 Mon Sep 17 00:00:00 2001
From: Matthew Mirvish <matthew at mm12.xyz>
Date: Sun, 1 Oct 2023 15:42:12 -0400
Subject: [PATCH] [ARM] Expose supportsTailCalls in ARMTargetTransformInfo

The ARM target doesn't support tail calls on certain older
architectures, however this information is not communicated to the
target transform information. This causes coroutine symmetric transfer
to fail as it adds musttail attributes which throw an assert during
code generation.
---
 llvm/lib/Target/ARM/ARMTargetTransformInfo.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/llvm/lib/Target/ARM/ARMTargetTransformInfo.h b/llvm/lib/Target/ARM/ARMTargetTransformInfo.h
index bb4b321b5300916..d1d699b62e3b24a 100644
--- a/llvm/lib/Target/ARM/ARMTargetTransformInfo.h
+++ b/llvm/lib/Target/ARM/ARMTargetTransformInfo.h
@@ -333,6 +333,12 @@ class ARMTTIImpl : public BasicTTIImplBase<ARMTTIImpl> {
 
   bool hasArmWideBranch(bool Thumb) const;
 
+  bool supportsTailCalls() const { return ST->supportsTailCall(); }
+
+  bool supportsTailCallFor(const CallBase *CB) const {
+    return supportsTailCalls();
+  }
+
   /// @}
 };
 



More information about the llvm-commits mailing list