@@ -588,7 +615,8 @@ ABIArgInfo ARMABIInfo::classifyReturnType(QualType RetTy,
bool isVariadic,
// Otherwise this is an AAPCS variant.
- if (isEmptyRecord(getContext(), RetTy, true))
+ if (isEmptyRecord(getContext(), RetTy, true) ||
+ getContext().getTypeSize(RetTy)
@@ -752,10 +780,13 @@ RValue ARMABIInfo::EmitVAArg(CodeGenFunction &CGF,
Address VAListAddr,
CharUnits SlotSize = CharUnits::fromQuantity(4);
// Empty records are ignored for parameter passing purposes.
- if (isEmptyRecord(getContext(), Ty, true))
+ uint64_t Size = getC
https://github.com/ostannard closed
https://github.com/llvm/llvm-project/pull/124760
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ostannard updated
https://github.com/llvm/llvm-project/pull/124762
>From 4d883f068c5061e60e90e51d149a361920b431d2 Mon Sep 17 00:00:00 2001
From: Oliver Stannard
Date: Thu, 12 Dec 2024 15:29:31 +
Subject: [PATCH 1/5] [ARM] Empty structs are 1-byte for C++ ABI
For C++ (but
@@ -0,0 +1,50 @@
+// RUN: llvm-mc -triple=aarch64 %s -o - | FileCheck %s --check-prefix=ASM
+// RUN: llvm-mc -triple=aarch64 -filetype=obj %s -o - | llvm-readelf
--hex-dump=.ARM.attributes - | FileCheck %s --check-prefix=ELF
+
+// ASM: .aeabi_subsection private_subsection_1,
@@ -148,13 +150,177 @@ class AArch64TargetAsmStreamer : public
AArch64TargetStreamer {
OS << "\t.seh_save_any_reg_px\tq" << Reg << ", " << Offset << "\n";
}
+ void emitAttribute(StringRef VendorName, unsigned Tag, unsigned Value,
+ std::string Strin
@@ -7806,6 +7815,261 @@ bool
AArch64AsmParser::parseDirectiveSEHSaveAnyReg(SMLoc L, bool Paired,
return false;
}
+bool AArch64AsmParser::parseDirectiveAeabiSubSectionHeader(SMLoc L) {
+ // Expecting 3 AsmToken::Identifier after '.aeabi_subsection', a name and 2
+ // param
@@ -7806,6 +7815,261 @@ bool
AArch64AsmParser::parseDirectiveSEHSaveAnyReg(SMLoc L, bool Paired,
return false;
}
+bool AArch64AsmParser::parseDirectiveAeabiSubSectionHeader(SMLoc L) {
+ // Expecting 3 AsmToken::Identifier after '.aeabi_subsection', a name and 2
+ // param
@@ -0,0 +1,80 @@
+// RUN: not llvm-mc -triple=aarch64 %s -o %t > %t.out 2>&1
+// RUN: FileCheck --input-file=%t.out --check-prefix=ERR %s
+
+.aeabi_subsection aeabi_pauthabi, optional, uleb128
+// ERR: error: aeabi_pauthabi must be marked as required
+// ERR-NEXT: .aeabi_subsecti
@@ -0,0 +1,140 @@
+//===-- AArch64BuildAttributes.cpp - AArch64 Build Attributes
-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -0,0 +1,88 @@
+//===-- AArch64BuildAttributes.h - AARch64 Build Attributes -*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
@@ -0,0 +1,140 @@
+//===-- AArch64BuildAttributes.cpp - AArch64 Build Attributes
-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -0,0 +1,80 @@
+// RUN: not llvm-mc -triple=aarch64 %s -o %t > %t.out 2>&1
+// RUN: FileCheck --input-file=%t.out --check-prefix=ERR %s
+
+.aeabi_subsection aeabi_pauthabi, optional, uleb128
+// ERR: error: aeabi_pauthabi must be marked as required
+// ERR-NEXT: .aeabi_subsecti
@@ -0,0 +1,62 @@
+// RUN: not llvm-mc -triple=aarch64 %s -o %t > %t.out 2>&1
+// RUN: FileCheck --input-file=%t.out --check-prefix=ERR %s
+
+.aeabi_subsection aeabi_pauthabi, required, uleb128
+.aeabi_attribute Tag_Feature_BTI, 1
+// ERR: error: Unknown AArch64 build attribute 'T
@@ -7806,6 +7815,261 @@ bool
AArch64AsmParser::parseDirectiveSEHSaveAnyReg(SMLoc L, bool Paired,
return false;
}
+bool AArch64AsmParser::parseDirectiveAeabiSubSectionHeader(SMLoc L) {
+ // Expecting 3 AsmToken::Identifier after '.aeabi_subsection', a name and 2
+ // param
@@ -148,13 +150,177 @@ class AArch64TargetAsmStreamer : public
AArch64TargetStreamer {
OS << "\t.seh_save_any_reg_px\tq" << Reg << ", " << Offset << "\n";
}
+ void emitAttribute(StringRef VendorName, unsigned Tag, unsigned Value,
+ std::string Strin
@@ -7806,6 +7815,261 @@ bool
AArch64AsmParser::parseDirectiveSEHSaveAnyReg(SMLoc L, bool Paired,
return false;
}
+bool AArch64AsmParser::parseDirectiveAeabiSubSectionHeader(SMLoc L) {
+ // Expecting 3 AsmToken::Identifier after '.aeabi_subsection', a name and 2
+ // param
@@ -7806,6 +7815,261 @@ bool
AArch64AsmParser::parseDirectiveSEHSaveAnyReg(SMLoc L, bool Paired,
return false;
}
+bool AArch64AsmParser::parseDirectiveAeabiSubSectionHeader(SMLoc L) {
+ // Expecting 3 AsmToken::Identifier after '.aeabi_subsection', a name and 2
+ // param
@@ -54,6 +54,7 @@
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/TargetRegistry.h"
+#include "llvm/Support/ARMBuildAttributes.h"
ostannard wrote:
What are we using from `ARMBuildAttributes.h` in this file, and can it be moved
@@ -151,3 +151,97 @@ llvm::createAArch64ObjectTargetStreamer(MCStreamer &S,
MCTargetStreamer *llvm::createAArch64NullTargetStreamer(MCStreamer &S) {
return new AArch64TargetStreamer(S);
}
+
+void AArch64TargetStreamer::emitAtributesSubsection(
+StringRef VendorName, AArch
@@ -0,0 +1,140 @@
+//===-- AArch64BuildAttributes.cpp - AArch64 Build Attributes
-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -0,0 +1,62 @@
+// RUN: not llvm-mc -triple=aarch64 %s -o %t > %t.out 2>&1
ostannard wrote:
The `not` only applies to the first command, so the `FileCheck` will run and
report errors as normal. There are plenty of existing tests which do this, for
example `te
https://github.com/ostannard updated
https://github.com/llvm/llvm-project/pull/121943
>From 2a69ca9ba3b67967e0f88a9b96ac8bea44220842 Mon Sep 17 00:00:00 2001
From: Oliver Stannard
Date: Thu, 19 Dec 2024 09:12:19 +
Subject: [PATCH 1/3] [Clang] Re-write codegen for atomic_test_and_set and
at
@@ -3686,12 +3687,18 @@ ExprResult Sema::BuildAtomicExpr(SourceRange CallRange,
SourceRange ExprRange,
C11CmpXchg,
// bool __atomic_compare_exchange(A *, C *, CP, bool, int, int)
-GNUCmpXchg
+GNUCmpXchg,
+
+// bool __atomic_test_and_set(A *, int)
+Test
@@ -3911,14 +3926,31 @@ ExprResult Sema::BuildAtomicExpr(SourceRange CallRange,
SourceRange ExprRange,
}
}
- // Pointer to object of size zero is not allowed.
- if (RequireCompleteType(Ptr->getBeginLoc(), AtomTy,
- diag::err_incomplete_type))
@@ -3963,8 +3995,8 @@ ExprResult Sema::BuildAtomicExpr(SourceRange CallRange,
SourceRange ExprRange,
return ExprError();
}
- if (!IsC11 && !AtomTy.isTriviallyCopyableType(Context) &&
- !AtomTy->isScalarType()) {
+ if (!IsC11 && Form != TestAndSet && Form != Clear
@@ -284,11 +284,26 @@ void f(_Atomic(int) *i, const _Atomic(int) *ci,
const volatile int flag_k = 0;
volatile int flag = 0;
- (void)(int)__atomic_test_and_set(&flag_k, memory_order_seq_cst); //
expected-warning {{passing 'const volatile int *' to parameter of type
'vola
@@ -1977,16 +1977,16 @@ def AtomicNandFetch : AtomicBuiltin {
let Prototype = "void(...)";
}
-def AtomicTestAndSet : Builtin {
+def AtomicTestAndSet : AtomicBuiltin {
let Spellings = ["__atomic_test_and_set"];
- let Attributes = [NoThrow];
- let Prototype = "bool(void v
https://github.com/ostannard created
https://github.com/llvm/llvm-project/pull/123336
The FEAT_SPEv1p2 feature (known to LLVM as FeatureSPE_EEF and +spe-eef) was
incorrectly marked as a required feature of Armv8.7-A (and later), which is
incorrect because it is optional, and some CPUs do not i
https://github.com/ostannard updated
https://github.com/llvm/llvm-project/pull/123336
>From 8f958b7099d9c6999731b7ce0305fcfbe4705940 Mon Sep 17 00:00:00 2001
From: Oliver Stannard
Date: Fri, 17 Jan 2025 12:08:38 +
Subject: [PATCH 1/3] [AArch64] refactor optional v9.x features inherited from
https://github.com/ostannard updated
https://github.com/llvm/llvm-project/pull/123336
>From 8f958b7099d9c6999731b7ce0305fcfbe4705940 Mon Sep 17 00:00:00 2001
From: Oliver Stannard
Date: Fri, 17 Jan 2025 12:08:38 +
Subject: [PATCH 1/4] [AArch64] refactor optional v9.x features inherited from
ostannard wrote:
This is a system register only feature, but not one which we have enabled
unconditionally. If we're going to turn it on only for architectures/CPUs which
(can) have it, then I think it's better to be precise, which is what this patch
does. Since it's only a system register we
@@ -7806,6 +7815,267 @@ bool
AArch64AsmParser::parseDirectiveSEHSaveAnyReg(SMLoc L, bool Paired,
return false;
}
+bool AArch64AsmParser::parseDirectiveAeabiSubSectionHeader(SMLoc L) {
+ // Expecting 3 AsmToken::Identifier after '.aeabi_subsection', a name and 2
+ // param
@@ -7806,6 +7815,267 @@ bool
AArch64AsmParser::parseDirectiveSEHSaveAnyReg(SMLoc L, bool Paired,
return false;
}
+bool AArch64AsmParser::parseDirectiveAeabiSubSectionHeader(SMLoc L) {
+ // Expecting 3 AsmToken::Identifier after '.aeabi_subsection', a name and 2
+ // param
@@ -0,0 +1,123 @@
+//===-- AArch64BuildAttributes.cpp - AArch64 Build Attributes
-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -148,13 +150,151 @@ class AArch64TargetAsmStreamer : public
AArch64TargetStreamer {
OS << "\t.seh_save_any_reg_px\tq" << Reg << ", " << Offset << "\n";
}
+ void emitAttribute(StringRef VendorName, unsigned Tag, unsigned Value,
+ std::string Strin
@@ -148,13 +150,151 @@ class AArch64TargetAsmStreamer : public
AArch64TargetStreamer {
OS << "\t.seh_save_any_reg_px\tq" << Reg << ", " << Offset << "\n";
}
+ void emitAttribute(StringRef VendorName, unsigned Tag, unsigned Value,
+ std::string Strin
@@ -7806,6 +7815,267 @@ bool
AArch64AsmParser::parseDirectiveSEHSaveAnyReg(SMLoc L, bool Paired,
return false;
}
+bool AArch64AsmParser::parseDirectiveAeabiSubSectionHeader(SMLoc L) {
+ // Expecting 3 AsmToken::Identifier after '.aeabi_subsection', a name and 2
+ // param
ostannard wrote:
That looks like the expected consequence of this change:
* Previously, the anonymous bitfield was erroneously given a 64-bit container,
so it occupied 7 copies of the container type, starting at byte 8 of the struct
and ending at 64.
* Now, it is given a 128-bit container, as r
https://github.com/ostannard approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/137771
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ostannard wrote:
I'd assumed that this was a sufficiently uncommon edge-case that it wasn't
worth a release note, but I'll keep that in mind in future and add release
notes for things like this.
https://github.com/llvm/llvm-project/pull/126774
___
cf
ostannard wrote:
Ping
https://github.com/llvm/llvm-project/pull/127068
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ostannard wrote:
Ping
https://github.com/llvm/llvm-project/pull/126774
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ostannard closed
https://github.com/llvm/llvm-project/pull/126774
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ostannard updated
https://github.com/llvm/llvm-project/pull/126774
>From 223eb6f3153bce087306f54c398034ff7a64c1d1 Mon Sep 17 00:00:00 2001
From: Oliver Stannard
Date: Tue, 11 Feb 2025 17:40:55 +
Subject: [PATCH 1/4] Add tests showing bugs
---
clang/test/CodeGen/aapcs-al
201 - 245 of 245 matches
Mail list logo