[llvm] [ARM] Use FPRegs for fastcc calling convention detection. (PR #184593)
David Green via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 4 03:28:42 PST 2026
https://github.com/davemgreen created https://github.com/llvm/llvm-project/pull/184593
This was using VFP2, but nowadays should use hasFPRegs to detect the effective calling convention.
Fixes #109922.
>From f51d9c542a0ec24977d37ef7a512c704d1949bea Mon Sep 17 00:00:00 2001
From: David Green <david.green at arm.com>
Date: Wed, 4 Mar 2026 11:26:24 +0000
Subject: [PATCH] [ARM] Use FPRegs for fastcc calling convention detection.
This was using VFP2, but nowadays should use hasFPRegs to detect the effective
calling convention.
Fixes #109922.
---
llvm/lib/Target/ARM/ARMISelLowering.cpp | 4 ++--
llvm/test/CodeGen/Thumb2/mve-fastcctail.ll | 23 ++++++++++++++++++++++
2 files changed, 25 insertions(+), 2 deletions(-)
create mode 100644 llvm/test/CodeGen/Thumb2/mve-fastcctail.ll
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index eb757df6a9f28..5e56d87b06570 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -1714,10 +1714,10 @@ ARMTargetLowering::getEffectiveCallingConv(CallingConv::ID CC,
case CallingConv::Fast:
case CallingConv::CXX_FAST_TLS:
if (!getTM().isAAPCS_ABI()) {
- if (Subtarget->hasVFP2Base() && !Subtarget->isThumb1Only() && !isVarArg)
+ if (Subtarget->hasFPRegs() && !Subtarget->isThumb1Only() && !isVarArg)
return CallingConv::Fast;
return CallingConv::ARM_APCS;
- } else if (Subtarget->hasVFP2Base() && !Subtarget->isThumb1Only() &&
+ } else if (Subtarget->hasFPRegs() && !Subtarget->isThumb1Only() &&
!isVarArg)
return CallingConv::ARM_AAPCS_VFP;
else
diff --git a/llvm/test/CodeGen/Thumb2/mve-fastcctail.ll b/llvm/test/CodeGen/Thumb2/mve-fastcctail.ll
new file mode 100644
index 0000000000000..d39b6f9ca7e8b
--- /dev/null
+++ b/llvm/test/CodeGen/Thumb2/mve-fastcctail.ll
@@ -0,0 +1,23 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
+; RUN: llc -mtriple=thumbv8.1m.main-none-none-eabihf -mattr=+mve -verify-machineinstrs %s -o - | FileCheck %s
+
+%struct.S51 = type { <16 x i8>, <16 x i8> }
+
+define internal %struct.S51 @F33() {
+; CHECK-LABEL: F33:
+; CHECK: @ %bb.0: @ %entry
+; CHECK-NEXT: vmov.i32 q0, #0x0
+; CHECK-NEXT: vmov.i32 q1, #0x0
+; CHECK-NEXT: bx lr
+entry:
+ ret %struct.S51 zeroinitializer
+}
+
+define internal fastcc void @F32() {
+; CHECK-LABEL: F32:
+; CHECK: @ %bb.0: @ %entry
+; CHECK-NEXT: b F33
+entry:
+ %call = tail call %struct.S51 @F33()
+ ret void
+}
More information about the llvm-commits
mailing list