@@ -8,31 +8,28 @@
// CHECK-C-LABEL: @test_svstr_vnum_za(
// CHECK-CXX-LABEL: @_Z18test_svstr_vnum_zajPv(
// CHECK-NEXT: entry:
-// CHECK-NEXT:tail call void @llvm.aarch64.sme.str(i32 [[SLICE_BASE:%.*]],
ptr [[PTR:%.*]])
+// CHECK-NEXT:tail call void @llvm.aarch64.sme.
@@ -9665,18 +9665,34 @@ Value *CodeGenFunction::EmitSMEZero(const SVETypeFlags
&TypeFlags,
Value *CodeGenFunction::EmitSMELdrStr(const SVETypeFlags &TypeFlags,
SmallVectorImpl &Ops,
unsigned IntID) {
-
@@ -9665,18 +9665,34 @@ Value *CodeGenFunction::EmitSMEZero(const SVETypeFlags
&TypeFlags,
Value *CodeGenFunction::EmitSMELdrStr(const SVETypeFlags &TypeFlags,
SmallVectorImpl &Ops,
unsigned IntID) {
-
@@ -8,7 +8,7 @@
// CHECK-C-LABEL: @test_svldr_vnum_za(
// CHECK-CXX-LABEL: @_Z18test_svldr_vnum_zajPKv(
// CHECK-NEXT: entry:
-// CHECK-NEXT:tail call void @llvm.aarch64.sme.ldr(i32 [[SLICE_BASE:%.*]],
ptr [[PTR:%.*]])
kmclaughlin-arm wrote:
Were these c
https://github.com/kmclaughlin-arm approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/69321
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: Kerry McLaughlin
Date: 2020-03-17T11:04:19Z
New Revision: af64948e2a050d1ef3b7fd314ed07b2a2fe402a5
URL:
https://github.com/llvm/llvm-project/commit/af64948e2a050d1ef3b7fd314ed07b2a2fe402a5
DIFF:
https://github.com/llvm/llvm-project/commit/af64948e2a050d1ef3b7fd314ed07b2a2fe402a5.diff
L
https://github.com/kmclaughlin-arm created
https://github.com/llvm/llvm-project/pull/107581
When functions are passed as arguments to a lambda, it's possible for
the mangled names of these functions to be the same despite the prototypes
being different. For example:
```
int non_streaming_fn(i
kmclaughlin-arm wrote:
> Isn't this a bug in the mangler? I mean, it's better to print an error rather
> than silently miscompile, but this doesn't really solve the issue.
Hi @efriedma-quic,
The SME type attributes are not part of the name mangling. We figured an error
message would be useful
@@ -8287,6 +8289,13 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
SDValue InGlue;
if (RequiresSMChange) {
+
+if (Subtarget->hasSVE()) {
kmclaughlin-arm wrote:
I've made changes to `needsAsyncDwarfUnwindInfo` in
AArch64MachineFunctionInfo
@@ -196,12 +196,14 @@ bool AArch64FunctionInfo::needsAsyncDwarfUnwindInfo(
const MachineFunction &MF) const {
if (!NeedsAsyncDwarfUnwindInfo) {
const Function &F = MF.getFunction();
+const AArch64FunctionInfo *AFI = MF.getInfo();
// The check got "minsize" i
@@ -214,7 +232,8 @@ declare double @za_shared_callee(double) "aarch64_inout_za"
define double @za_new_caller_to_za_shared_callee(double %x) nounwind noinline
optnone "aarch64_new_za"{
; CHECK-COMMON-LABEL: za_new_caller_to_za_shared_callee:
; CHECK-COMMON: // %bb.0: //
@@ -196,12 +196,14 @@ bool AArch64FunctionInfo::needsAsyncDwarfUnwindInfo(
const MachineFunction &MF) const {
if (!NeedsAsyncDwarfUnwindInfo) {
const Function &F = MF.getFunction();
+const AArch64FunctionInfo *AFI = MF.getInfo();
// The check got "minsize" i
@@ -214,7 +232,8 @@ declare double @za_shared_callee(double) "aarch64_inout_za"
define double @za_new_caller_to_za_shared_callee(double %x) nounwind noinline
optnone "aarch64_new_za"{
; CHECK-COMMON-LABEL: za_new_caller_to_za_shared_callee:
; CHECK-COMMON: // %bb.0: //
https://github.com/kmclaughlin-arm closed
https://github.com/llvm/llvm-project/pull/83301
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1552,6 +1553,57 @@ bool AArch64ExpandPseudo::expandMI(MachineBasicBlock
&MBB,
case AArch64::COALESCER_BARRIER_FPR128:
MI.eraseFromParent();
return true;
+ case AArch64::VGSavePseudo:
+ case AArch64::VGRestorePseudo: {
+ MachineFunction &MF = *MBB.getPa
@@ -1552,6 +1553,57 @@ bool AArch64ExpandPseudo::expandMI(MachineBasicBlock
&MBB,
case AArch64::COALESCER_BARRIER_FPR128:
MI.eraseFromParent();
return true;
+ case AArch64::VGSavePseudo:
+ case AArch64::VGRestorePseudo: {
+ MachineFunction &MF = *MBB.getPa
@@ -3768,6 +3768,12 @@ def err_conflicting_attributes_arm_state : Error<
"conflicting attributes for state '%0'">;
def err_sme_streaming_cannot_be_multiversioned : Error<
"streaming function cannot be multi-versioned">;
+def err_sme_streaming_mode_change_no_sve : Error<
+
@@ -8287,6 +8289,13 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
SDValue InGlue;
if (RequiresSMChange) {
+
+if (Subtarget->hasSVE()) {
kmclaughlin-arm wrote:
> when I compile some code with -fno-asynchronous-unwind-tables, it will still
@@ -8287,6 +8289,13 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
SDValue InGlue;
if (RequiresSMChange) {
+
+if (Subtarget->hasSVE()) {
kmclaughlin-arm wrote:
If we still emit the spill of VG with `-fno-asynchronous-unwind-tables`, I
don
@@ -8001,6 +8007,22 @@ void Sema::checkCall(NamedDecl *FDecl, const
FunctionProtoType *Proto,
}
}
+// SME functions may require SVE to be available for unwinding, as the
+// value of VG needs to be preserved across streaming-mode changes.
+if (CallerFD &
kmclaughlin-arm wrote:
Gentle ping :)
https://github.com/llvm/llvm-project/pull/83301
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3730,6 +3730,12 @@ def warn_gnu_inline_cplusplus_without_extern : Warning<
"'gnu_inline' attribute without 'extern' in C++ treated as externally"
" available, this changed in Clang 10">,
InGroup>;
+def warn_sme_streaming_mode_change_no_sve : Warning<
+ "function requ
@@ -221,6 +224,15 @@ def : Pat<(AArch64_smstop (i32 svcr_op:$pstate), (i64
/*AArch64SME::Always*/0)),
(MSRpstatesvcrImm1 svcr_op:$pstate, 0b0)>;
+// Pseudo to insert cfi_offset/cfi_restore instructions. Used to save or
restore
+// the streaming value of VG around
https://github.com/kmclaughlin-arm updated
https://github.com/llvm/llvm-project/pull/107581
>From 1e6f25c517d8d1adeeaf59f826141efdcad8f05a Mon Sep 17 00:00:00 2001
From: Kerry McLaughlin
Date: Fri, 6 Sep 2024 10:13:33 +
Subject: [PATCH 1/2] [Clang] Emit error for duplicate mangled names wit
kmclaughlin-arm wrote:
>
> I'm having a bit of trouble understanding the way the new code is structured.
> What makes the definition of lambda call operators special here? Do we not
> call GetOrCreateLLVMFunction with IsForDefinition set?
When I added this error I incorrectly thought GetOrCre
https://github.com/kmclaughlin-arm updated
https://github.com/llvm/llvm-project/pull/107581
>From 1e6f25c517d8d1adeeaf59f826141efdcad8f05a Mon Sep 17 00:00:00 2001
From: Kerry McLaughlin
Date: Fri, 6 Sep 2024 10:13:33 +
Subject: [PATCH 1/3] [Clang] Emit error for duplicate mangled names wit
https://github.com/kmclaughlin-arm updated
https://github.com/llvm/llvm-project/pull/107581
>From 1e6f25c517d8d1adeeaf59f826141efdcad8f05a Mon Sep 17 00:00:00 2001
From: Kerry McLaughlin
Date: Fri, 6 Sep 2024 10:13:33 +
Subject: [PATCH 1/6] [Clang] Emit error for duplicate mangled names wit
https://github.com/kmclaughlin-arm updated
https://github.com/llvm/llvm-project/pull/107581
>From 1e6f25c517d8d1adeeaf59f826141efdcad8f05a Mon Sep 17 00:00:00 2001
From: Kerry McLaughlin
Date: Fri, 6 Sep 2024 10:13:33 +
Subject: [PATCH 1/5] [Clang] Emit error for duplicate mangled names wit
kmclaughlin-arm wrote:
> Oh, that makes sense... so the issue is generally with functions we emit
> lazily?
> I'd say it's reasonable to emit an error if we have two definitions for the
> same symbol, even if we don't end up emitting them because they're deferred.
Yes, I believe so. I've moved
https://github.com/kmclaughlin-arm created
https://github.com/llvm/llvm-project/pull/114209
Similar to arm_sve_vector_bits, the mangling of function types is implemented
as a pseudo template if there are any SME attributes present, i.e.
`__SME_ATTRS`
For example, the following function:
kmclaughlin-arm wrote:
> For the lambda example, there are only three relevant calls to
> GetOrCreateLLVMFunction; one for each function with IsInDefinition false, but
> then only one with IsInDefinition true.
>
> It's not clear to me why the two cases are different, and I don't really want
>
https://github.com/kmclaughlin-arm updated
https://github.com/llvm/llvm-project/pull/114209
>From ff5b6defc0df704f63fffabc731bcd38a1e24d3b Mon Sep 17 00:00:00 2001
From: Kerry McLaughlin
Date: Tue, 15 Oct 2024 15:22:56 +
Subject: [PATCH 1/3] [Clang][AArch64] Include SME attributes in the na
@@ -3535,6 +3536,39 @@ void CXXNameMangler::mangleExtFunctionInfo(const
FunctionType *T) {
// FIXME: noreturn
}
+bool hasSharedState(unsigned SMEAttrs) {
+ switch (SMEAttrs) {
+ case FunctionType::ARM_In:
+ case FunctionType::ARM_Out:
+ case FunctionType::ARM_InOut:
+
@@ -3536,35 +3536,64 @@ void CXXNameMangler::mangleExtFunctionInfo(const
FunctionType *T) {
// FIXME: noreturn
}
-bool hasSharedState(unsigned SMEAttrs) {
+unsigned getZAState(unsigned SMEAttrs) {
switch (SMEAttrs) {
case FunctionType::ARM_In:
+return 1;
case F
https://github.com/kmclaughlin-arm updated
https://github.com/llvm/llvm-project/pull/114209
>From c62f48766cf24636045286449e98705a6a5bd76c Mon Sep 17 00:00:00 2001
From: Kerry McLaughlin
Date: Tue, 15 Oct 2024 15:22:56 +
Subject: [PATCH 1/5] [Clang][AArch64] Include SME attributes in the na
https://github.com/kmclaughlin-arm updated
https://github.com/llvm/llvm-project/pull/114209
>From c62f48766cf24636045286449e98705a6a5bd76c Mon Sep 17 00:00:00 2001
From: Kerry McLaughlin
Date: Tue, 15 Oct 2024 15:22:56 +
Subject: [PATCH 1/6] [Clang][AArch64] Include SME attributes in the na
https://github.com/kmclaughlin-arm updated
https://github.com/llvm/llvm-project/pull/114209
>From ff5b6defc0df704f63fffabc731bcd38a1e24d3b Mon Sep 17 00:00:00 2001
From: Kerry McLaughlin
Date: Tue, 15 Oct 2024 15:22:56 +
Subject: [PATCH 1/4] [Clang][AArch64] Include SME attributes in the na
https://github.com/kmclaughlin-arm updated
https://github.com/llvm/llvm-project/pull/107581
>From 1e6f25c517d8d1adeeaf59f826141efdcad8f05a Mon Sep 17 00:00:00 2001
From: Kerry McLaughlin
Date: Fri, 6 Sep 2024 10:13:33 +
Subject: [PATCH 1/4] [Clang] Emit error for duplicate mangled names wit
@@ -0,0 +1,31 @@
+// REQUIRES: aarch64-registered-target
+
+// RUN: %clang_cc1 -triple aarch64 -emit-llvm -o - %s -verify -DTEST1
+// RUN: %clang_cc1 -triple aarch64 -target-feature +sme -target-feature +sme2
-emit-llvm -o - %s -verify -DTEST2
kmclaughlin-arm wro
kmclaughlin-arm wrote:
> For non-lambda methods, the way this works it that we call
> GetOrCreateLLVMFunction for both methods... for the first method, the
> `!Entry->isDeclaration()` would be false, but for the second one, it would be
> true because we've emitted the definition of the first m
https://github.com/kmclaughlin-arm closed
https://github.com/llvm/llvm-project/pull/114209
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmclaughlin-arm ready_for_review
https://github.com/llvm/llvm-project/pull/114209
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmclaughlin-arm updated
https://github.com/llvm/llvm-project/pull/114209
>From ff5b6defc0df704f63fffabc731bcd38a1e24d3b Mon Sep 17 00:00:00 2001
From: Kerry McLaughlin
Date: Tue, 15 Oct 2024 15:22:56 +
Subject: [PATCH 1/2] [Clang][AArch64] Include SME attributes in the na
https://github.com/kmclaughlin-arm edited
https://github.com/llvm/llvm-project/pull/114209
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmclaughlin-arm closed
https://github.com/llvm/llvm-project/pull/121338
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmclaughlin-arm updated
https://github.com/llvm/llvm-project/pull/121338
>From 8b8f191d9c6980f7342c0bea2681ffd8d1dbe90b Mon Sep 17 00:00:00 2001
From: Kerry McLaughlin
Date: Mon, 30 Dec 2024 13:24:34 +
Subject: [PATCH 1/2] [AArch64][SME] Disable inlining of callees with n
@@ -256,7 +256,7 @@ bool AArch64TTIImpl::areInlineCompatible(const Function
*Caller,
CalleeAttrs.set(SMEAttrs::SM_Enabled, true);
}
- if (CalleeAttrs.isNewZA())
kmclaughlin-arm wrote:
Thanks @MacDue, there should be a similar restriction in Clang whic
https://github.com/kmclaughlin-arm created
https://github.com/llvm/llvm-project/pull/121777
CheckFunctionDeclaration emits diagnostics if any SME attributes are used
by a function definition without the required +sme or +sme2 target features.
This patch adds similar diagnostics to CheckConstexpr
https://github.com/kmclaughlin-arm updated
https://github.com/llvm/llvm-project/pull/121777
>From 00772b871de43a5e30aca2a65a89675117cafbf1 Mon Sep 17 00:00:00 2001
From: Kerry McLaughlin
Date: Tue, 31 Dec 2024 17:22:02 +
Subject: [PATCH 1/2] [AArch64][SME] Add diagnostics to
CheckConstexpr
https://github.com/kmclaughlin-arm edited
https://github.com/llvm/llvm-project/pull/121777
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmclaughlin-arm ready_for_review
https://github.com/llvm/llvm-project/pull/121777
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmclaughlin-arm edited
https://github.com/llvm/llvm-project/pull/121777
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmclaughlin-arm updated
https://github.com/llvm/llvm-project/pull/121777
>From 00772b871de43a5e30aca2a65a89675117cafbf1 Mon Sep 17 00:00:00 2001
From: Kerry McLaughlin
Date: Tue, 31 Dec 2024 17:22:02 +
Subject: [PATCH 1/3] [AArch64][SME] Add diagnostics to
CheckConstexpr
@@ -1854,6 +1855,9 @@ bool Sema::CheckConstexprFunctionDefinition(const
FunctionDecl *NewFD,
}
}
+ if (Context.getTargetInfo().getTriple().isAArch64())
+ARM().CheckSMEFunctionDefAttributes(NewFD);
+
kmclaughlin-arm wrote:
Thanks, `ActOnStartOfLamb
@@ -1328,4 +1328,57 @@ void SemaARM::handleInterruptAttr(Decl *D, const
ParsedAttr &AL) {
ARMInterruptAttr(getASTContext(), AL, Kind));
}
+// Check if the function definition uses any AArch64 SME features without
+// having the '+sme' feature enabled and warn
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -std=c++23 -fsyntax-only
-verify %s
kmclaughlin-arm wrote:
I think adding attributes to lambdas before the parameter li
https://github.com/kmclaughlin-arm edited
https://github.com/llvm/llvm-project/pull/121777
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
kmclaughlin-arm wrote:
Please can you also extend `mangleSMEAttrs` in ItaniumMangle.cpp to include the
`__arm_agnostic` attribute?
https://github.com/llvm/llvm-project/pull/121788
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.l
kmclaughlin-arm wrote:
> LGTM 👍 You could maybe add a test to
> `clang/test/CodeGen/AArch64/sme-inline-callees-streaming-attrs.c` too (which
> tests `flatten`/`always_inline` statements).
Thanks for approving the changes!
I did already add some tests to sme-inline-callees-streaming-attrs.c usi
https://github.com/kmclaughlin-arm updated
https://github.com/llvm/llvm-project/pull/121777
>From 00772b871de43a5e30aca2a65a89675117cafbf1 Mon Sep 17 00:00:00 2001
From: Kerry McLaughlin
Date: Tue, 31 Dec 2024 17:22:02 +
Subject: [PATCH 1/4] [AArch64][SME] Add diagnostics to
CheckConstexpr
https://github.com/kmclaughlin-arm closed
https://github.com/llvm/llvm-project/pull/121777
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmclaughlin-arm approved this pull request.
https://github.com/llvm/llvm-project/pull/124750
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmclaughlin-arm approved this pull request.
https://github.com/llvm/llvm-project/pull/122899
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmclaughlin-arm approved this pull request.
https://github.com/llvm/llvm-project/pull/121788
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -7559,6 +7559,32 @@ The attributes ``__arm_in(S)``, ``__arm_out(S)``,
``__arm_inout(S)`` and
}];
}
+def ArmAgnosticDocs : Documentation {
+ let Category = DocCatArmSmeAttributes;
+ let Content = [{
+The ``__arm_agnostic`` keyword applies to prototyped function types an
101 - 165 of 165 matches
Mail list logo