[clang] [clang][FMV][AArch64] Improve streaming mode compatibility. (PR #100181)

2024-07-24 Thread Sander de Smalen via cfe-commits
@@ -11145,7 +11148,24 @@ bool Sema::areMultiversionVariantFunctionsCompatible( FunctionType::ExtInfo OldTypeInfo = OldType->getExtInfo(); FunctionType::ExtInfo NewTypeInfo = NewType->getExtInfo(); -if (OldTypeInfo.getCC() != NewTypeInfo.getCC()) +const auto *Ol

[clang] [clang][FMV][AArch64] Improve streaming mode compatibility. (PR #100181)

2024-07-24 Thread Sander de Smalen via cfe-commits
@@ -3183,6 +3183,25 @@ class ASTContext : public RefCountedBase { const FunctionDecl *FD, llvm::function_ref Pred) const; + bool areFMVCompatible(const FunctionDecl *FD1, +const FunctionDecl *FD2) const { +if (!hasSameType(FD1->getRetur

[clang] [clang][FMV][AArch64] Improve streaming mode compatibility. (PR #100181)

2024-07-24 Thread Sander de Smalen via cfe-commits
@@ -11145,7 +11148,22 @@ bool Sema::areMultiversionVariantFunctionsCompatible( FunctionType::ExtInfo OldTypeInfo = OldType->getExtInfo(); FunctionType::ExtInfo NewTypeInfo = NewType->getExtInfo(); -if (OldTypeInfo.getCC() != NewTypeInfo.getCC()) +const auto *Ol

[clang] [clang][FMV][AArch64] Improve streaming mode compatibility. (PR #100181)

2024-07-25 Thread Sander de Smalen via cfe-commits
@@ -0,0 +1,46 @@ +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -Waarch64-sme-attributes -fsyntax-only -verify %s +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -Waarch64-sme-attributes -fsyntax-only -verify=expected-cpp -x c++ %

[clang] [clang][FMV][AArch64] Improve streaming mode compatibility. (PR #100181)

2024-07-26 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm approved this pull request. Thanks for addressing the feedback @labrinea, LGTM! https://github.com/llvm/llvm-project/pull/100181 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [Clang] Demote always_inline error to warning for mismatching SME attrs (PR #100740)

2024-07-26 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm updated https://github.com/llvm/llvm-project/pull/100740 >From 596654157c6e1124d5eac9fd415d957179897b90 Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Fri, 26 Jul 2024 13:24:10 +0100 Subject: [PATCH 1/2] [Clang] Demote always_inline error to warning for

[clang] [Clang] Demote always_inline error to warning for mismatching SME attrs (PR #100740)

2024-07-26 Thread Sander de Smalen via cfe-commits
sdesmalen-arm wrote: > At a glance, this seems like a good use case for a warning + `DefaultError`? I'd rather not make that change, because in practice it will be unlikely that inlining will result in changes to runtime behaviour. We'd rather not burden the users with explicit errors for some

[clang] [Clang] Demote always_inline error to warning for mismatching SME attrs (PR #100740)

2024-07-26 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm updated https://github.com/llvm/llvm-project/pull/100740 >From 596654157c6e1124d5eac9fd415d957179897b90 Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Fri, 26 Jul 2024 13:24:10 +0100 Subject: [PATCH 1/2] [Clang] Demote always_inline error to warning for

[clang] [Clang] Demote always_inline error to warning for mismatching SME attrs (PR #100740)

2024-07-29 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm milestoned https://github.com/llvm/llvm-project/pull/100740 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Demote always_inline error to warning for mismatching SME attrs (PR #100740)

2024-07-29 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm closed https://github.com/llvm/llvm-project/pull/100740 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Demote always_inline error to warning for mismatching SME attrs (PR #100740)

2024-07-29 Thread Sander de Smalen via cfe-commits
sdesmalen-arm wrote: /cherry-pick 5430f73b501f9fc0a38c3768592f5f31bcbdf2f0 https://github.com/llvm/llvm-project/pull/100740 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang] Demote always_inline error to warning for mismatching SME attrs" (PR #100991)

2024-07-29 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm created https://github.com/llvm/llvm-project/pull/100991 Reverts llvm/llvm-project#100740 >From e3e9cde46626ff525442b21963c03675c6bfa368 Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Mon, 29 Jul 2024 10:18:27 +0100 Subject: [PATCH] =?UTF-8?q?Revert=20"[

[clang] Revert "[Clang] Demote always_inline error to warning for mismatching SME attrs" (PR #100991)

2024-07-29 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm closed https://github.com/llvm/llvm-project/pull/100991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland: "[Clang] Demote always_inline error to warning for mismatching SME attrs" (#100991) (PR #100996)

2024-07-29 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm created https://github.com/llvm/llvm-project/pull/100996 Test `aarch64-sme-inline-streaming-attrs.c` caused some buildbot failures, because the test was missing a `REQUIRES: aarch64-registered target`. This was because we've demoted the error to a warning, whic

[clang] Reland: "[Clang] Demote always_inline error to warning for mismatching SME attrs" (#100991) (PR #100996)

2024-07-29 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm closed https://github.com/llvm/llvm-project/pull/100996 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland: "[Clang] Demote always_inline error to warning for mismatching SME attrs" (#100991) (PR #100996)

2024-07-31 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm milestoned https://github.com/llvm/llvm-project/pull/100996 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland: "[Clang] Demote always_inline error to warning for mismatching SME attrs" (#100991) (PR #100996)

2024-07-31 Thread Sander de Smalen via cfe-commits
sdesmalen-arm wrote: /cherry-pick 389679d5f9055bffe8bbd25ae41f084a8d08e0f8 https://github.com/llvm/llvm-project/pull/100996 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] make SVE types known to device targets too (PR #99446)

2024-07-18 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm approved this pull request. https://github.com/llvm/llvm-project/pull/99446 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] make SVE types known to device targets too (PR #99446)

2024-07-19 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm closed https://github.com/llvm/llvm-project/pull/99446 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Extend diagnostics when warning non/streaming about … (PR #88380)

2024-04-23 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm approved this pull request. https://github.com/llvm/llvm-project/pull/88380 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AArch64] Add SME2.1 feature macros (PR #105657)

2024-08-26 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm milestoned https://github.com/llvm/llvm-project/pull/105657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AArch64] Add SME2.1 feature macros (PR #105657)

2024-08-26 Thread Sander de Smalen via cfe-commits
sdesmalen-arm wrote: /cherry-pick 2617023923175b0fd2a8cb94ad677c061c01627f https://github.com/llvm/llvm-project/pull/105657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 0708500 - [Clang] Remove bogus assert in are[Lax]CompatibleSveTypes()

2024-05-02 Thread Sander de Smalen via cfe-commits
Author: Sander de Smalen Date: 2024-05-02T16:13:37Z New Revision: 0708500ce0149c501e802b7ab6581770cc7a5334 URL: https://github.com/llvm/llvm-project/commit/0708500ce0149c501e802b7ab6581770cc7a5334 DIFF: https://github.com/llvm/llvm-project/commit/0708500ce0149c501e802b7ab6581770cc7a5334.diff L

[clang] 6a6fcbf - [Clang][AArch64] NFC: Add IsArmStreamingFunction.

2024-05-07 Thread Sander de Smalen via cfe-commits
Author: Sander de Smalen Date: 2024-05-07T15:33:24Z New Revision: 6a6fcbffbb31f83fab7425d43e28eb6aa39dbfe9 URL: https://github.com/llvm/llvm-project/commit/6a6fcbffbb31f83fab7425d43e28eb6aa39dbfe9 DIFF: https://github.com/llvm/llvm-project/commit/6a6fcbffbb31f83fab7425d43e28eb6aa39dbfe9.diff L

[clang] [Clang][AArch64] Require SVE or SSVE for scalable types. (PR #91356)

2024-05-07 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm created https://github.com/llvm/llvm-project/pull/91356 Scalable types are only available when: * The function is compiled with +sve * The function is compiled with +sme and the function is executed in Streaming-SVE mode. >From 1cc17981a612dcb31fba86c5d64c444f2

[clang] [Clang][AArch64] Require SVE or SSVE for scalable types. (PR #91356)

2024-05-07 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm updated https://github.com/llvm/llvm-project/pull/91356 >From 9cbff1320d6f47245c97559bf3c614b931e80f06 Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Fri, 3 May 2024 13:07:18 +0100 Subject: [PATCH] [Clang][AArch64] Require SVE or SSVE for scalable types.

[clang] [llvm] [AArch64][SME] Save VG for unwind info when changing streaming-mode (PR #83301)

2024-05-15 Thread Sander de Smalen via cfe-commits
@@ -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< +

[clang] [llvm] [AArch64][SME] Save VG for unwind info when changing streaming-mode (PR #83301)

2024-05-15 Thread Sander de Smalen via 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

[clang] [llvm] [AArch64][SME] Save VG for unwind info when changing streaming-mode (PR #83301)

2024-05-15 Thread Sander de Smalen via 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

[clang] [llvm] [AArch64][SME] Save VG for unwind info when changing streaming-mode (PR #83301)

2024-05-15 Thread Sander de Smalen via cfe-commits
@@ -8287,6 +8289,13 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI, SDValue InGlue; if (RequiresSMChange) { + +if (Subtarget->hasSVE()) { sdesmalen-arm wrote: I think we can only emit this pseudo when we have asynchronous unwind tables ena

[clang] [llvm] [AArch64][SME] Save VG for unwind info when changing streaming-mode (PR #83301)

2024-05-15 Thread Sander de Smalen via 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

[clang] [llvm] [AArch64][SME] Save VG for unwind info when changing streaming-mode (PR #83301)

2024-05-15 Thread Sander de Smalen via 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

[clang] [llvm] [AArch64][SME] Save VG for unwind info when changing streaming-mode (PR #83301)

2024-05-15 Thread Sander de Smalen via cfe-commits
@@ -8443,9 +8452,16 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI, if (RequiresSMChange) { assert(PStateSM && "Expected a PStateSM to be set"); + sdesmalen-arm wrote: nit: unnecessary newline. https://github.com/llvm/llvm-project/pull/83301

[clang] [llvm] [AArch64][SME] Save VG for unwind info when changing streaming-mode (PR #83301)

2024-05-15 Thread Sander de Smalen via cfe-commits
@@ -223,6 +228,12 @@ class AArch64FunctionInfo final : public MachineFunctionInfo { Register getPStateSMReg() const { return PStateSMReg; }; void setPStateSMReg(Register Reg) { PStateSMReg = Reg; }; + int64_t getVGIdx() const { return VGIdx; }; + void setVGIdx(unsigned

[clang] [llvm] [AArch64][SME] Save VG for unwind info when changing streaming-mode (PR #83301)

2024-05-15 Thread Sander de Smalen via 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

[clang] [Clang][AArch64] Require SVE or SSVE for scalable types. (PR #91356)

2024-05-16 Thread Sander de Smalen via cfe-commits
@@ -9,6 +9,12 @@ #include +#if defined __ARM_FEATURE_SME +#define MODE_ATTR __arm_streaming +#else +#define MODE_ATTR __arm_streaming_compatible sdesmalen-arm wrote: I guess not. I initially thought it would give some additional checks that the SVE instruc

[clang] [Clang][AArch64] Require SVE or SSVE for scalable types. (PR #91356)

2024-05-16 Thread Sander de Smalen via cfe-commits
@@ -8982,11 +8982,18 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) { const FunctionDecl *FD = cast(CurContext); llvm::StringMap CallerFeatureMap; Context.getFunctionFeatureMap(CallerFeatureMap, FD); -if (!Builtin::evaluateRequiredTargetFeatures( -

[clang] [Clang][AArch64] Require SVE or SSVE for scalable types. (PR #91356)

2024-05-16 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm updated https://github.com/llvm/llvm-project/pull/91356 >From 9cbff1320d6f47245c97559bf3c614b931e80f06 Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Fri, 3 May 2024 13:07:18 +0100 Subject: [PATCH 1/2] [Clang][AArch64] Require SVE or SSVE for scalable typ

[clang] [Clang][AArch64] Use __clang_arm_builtin_alias for overloaded svreinterpret's (PR #92427)

2024-05-16 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm created https://github.com/llvm/llvm-project/pull/92427 The intrinsics are currently defined as: __aio __attribute__((target("sve"))) svint8_t svreinterpret_s8(svuint8_t op) __arm_streaming_compatible { return __builtin_sve_reinterpret_s8_u8(op); } wh

[clang] [Clang][AArch64] Require SVE or SSVE for scalable types. (PR #91356)

2024-05-17 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm closed https://github.com/llvm/llvm-project/pull/91356 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Use __clang_arm_builtin_alias for overloaded svreinterpret's (PR #92427)

2024-05-23 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm closed https://github.com/llvm/llvm-project/pull/92427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 990bab8 - [ScalableVectors] Warn instead of error for invalid size requests.

2022-01-20 Thread Sander de Smalen via cfe-commits
Author: Sander de Smalen Date: 2022-01-20T16:42:08Z New Revision: 990bab89fff75b9afb98762f6e90eb634afc6d42 URL: https://github.com/llvm/llvm-project/commit/990bab89fff75b9afb98762f6e90eb634afc6d42 DIFF: https://github.com/llvm/llvm-project/commit/990bab89fff75b9afb98762f6e90eb634afc6d42.diff L

[clang] 0f7bbbc - Always emit error for wrong interfaces to scalable vectors, unless cmdline flag is passed.

2021-04-02 Thread Sander de Smalen via cfe-commits
Author: Sander de Smalen Date: 2021-04-02T10:55:22+01:00 New Revision: 0f7bbbc481e20a152c74bc315f8995b62d54c8c0 URL: https://github.com/llvm/llvm-project/commit/0f7bbbc481e20a152c74bc315f8995b62d54c8c0 DIFF: https://github.com/llvm/llvm-project/commit/0f7bbbc481e20a152c74bc315f8995b62d54c8c0.di

[clang] 6bf806b - [AArch64] ACLE: Fix issue for mismatching enum types with builtins.

2021-04-12 Thread Sander de Smalen via cfe-commits
Author: Sander de Smalen Date: 2021-04-12T11:16:28+01:00 New Revision: 6bf806b3e2fddf79fa0326df1da341de9da35d08 URL: https://github.com/llvm/llvm-project/commit/6bf806b3e2fddf79fa0326df1da341de9da35d08 DIFF: https://github.com/llvm/llvm-project/commit/6bf806b3e2fddf79fa0326df1da341de9da35d08.di

[clang] fa936b6 - [AArch64][SVE] Fix dup/dupq intrinsics for C++.

2021-04-13 Thread Sander de Smalen via cfe-commits
Author: Sander de Smalen Date: 2021-04-13T10:55:20+01:00 New Revision: fa936b610fd019b73de82f61de83bae553251fdb URL: https://github.com/llvm/llvm-project/commit/fa936b610fd019b73de82f61de83bae553251fdb DIFF: https://github.com/llvm/llvm-project/commit/fa936b610fd019b73de82f61de83bae553251fdb.di

[clang] 204aaf8 - [AArch64][SVE] Always use overloaded methods instead of preprocessor macro.

2021-04-13 Thread Sander de Smalen via cfe-commits
Author: Sander de Smalen Date: 2021-04-13T21:12:53+01:00 New Revision: 204aaf879548616df407f662bc03d28b8d08d1fb URL: https://github.com/llvm/llvm-project/commit/204aaf879548616df407f662bc03d28b8d08d1fb DIFF: https://github.com/llvm/llvm-project/commit/204aaf879548616df407f662bc03d28b8d08d1fb.di

[clang] [clang][AArch64] Add SME2.1 feature macros (PR #105657)

2024-08-22 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm approved this pull request. Thanks, this looks good to me. https://github.com/llvm/llvm-project/pull/105657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [Clang][SveEmitter] Split up TargetGuard into SVE and SME component. (PR #96482)

2024-06-24 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm created https://github.com/llvm/llvm-project/pull/96482 One reason to want to split this up is to simplify the code added in #93802, where it checks the SME streaming-mode requirements for a builtin by checking for the absence of SVE. If the target guards are s

[clang] [Clang][SveEmitter] Split up TargetGuard into SVE and SME component. (PR #96482)

2024-06-24 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm closed https://github.com/llvm/llvm-project/pull/96482 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CLANG][LLVM][AArch64]Add SME2.1 intrinsics for MOVAZ tile to vector,… (PR #88499)

2024-06-25 Thread Sander de Smalen via cfe-commits
sdesmalen-arm wrote: Hi @CarolineConcatto could you give a quick status update on this PR? Is there any reason you've held off merging it? https://github.com/llvm/llvm-project/pull/88499 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[clang] [Clang] Emit error for duplicate mangled names within a lambda (PR #107581)

2024-09-16 Thread Sander de Smalen via cfe-commits
@@ -4652,18 +4652,35 @@ llvm::Constant *CodeGenModule::GetOrCreateLLVMFunction( // If there are two attempts to define the same mangled name, issue an // error. -if (IsForDefinition && !Entry->isDeclaration()) { - GlobalDecl OtherGD; - // Check that GD is

[clang] [Clang] Emit error for duplicate mangled names within a lambda (PR #107581)

2024-09-16 Thread Sander de Smalen via cfe-commits
@@ -0,0 +1,30 @@ +// REQUIRES: aarch64-registered-target + +// RUN: %clang_cc1 -triple aarch64 -target-feature +sme -target-feature +sme2 -emit-llvm -o - %s -verify -DTEST1 +// RUN: %clang_cc1 -triple aarch64 -target-feature +sme -target-feature +sme2 -emit-llvm -o - %s -verify

[clang] [Clang] Emit error for duplicate mangled names within a lambda (PR #107581)

2024-09-16 Thread Sander de Smalen via cfe-commits
@@ -0,0 +1,30 @@ +// REQUIRES: aarch64-registered-target + +// RUN: %clang_cc1 -triple aarch64 -target-feature +sme -target-feature +sme2 -emit-llvm -o - %s -verify -DTEST1 +// RUN: %clang_cc1 -triple aarch64 -target-feature +sme -target-feature +sme2 -emit-llvm -o - %s -verify

[clang] [Clang] Emit error for duplicate mangled names within a lambda (PR #107581)

2024-09-16 Thread Sander de Smalen via cfe-commits
@@ -4652,18 +4652,35 @@ llvm::Constant *CodeGenModule::GetOrCreateLLVMFunction( // If there are two attempts to define the same mangled name, issue an // error. -if (IsForDefinition && !Entry->isDeclaration()) { - GlobalDecl OtherGD; - // Check that GD is

[clang] [Clang] Emit error for duplicate mangled names within a lambda (PR #107581)

2024-09-16 Thread Sander de Smalen via cfe-commits
@@ -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 sdesmalen-arm wrote

[clang] [Clang][AArch64] Fix checkArmStreamingBuiltin for 'sve-b16b16' (PR #109420)

2024-10-08 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm closed https://github.com/llvm/llvm-project/pull/109420 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 34f8fbd - [Clang][AArch64] svadda is not available in streaming mode

2024-11-11 Thread Sander de Smalen via cfe-commits
Author: Sander de Smalen Date: 2024-11-11T08:53:36Z New Revision: 34f8fbd269fc0d2d7d527d3661faea3eeb4587ac URL: https://github.com/llvm/llvm-project/commit/34f8fbd269fc0d2d7d527d3661faea3eeb4587ac DIFF: https://github.com/llvm/llvm-project/commit/34f8fbd269fc0d2d7d527d3661faea3eeb4587ac.diff L

[clang] [Clang][AArch64] Fix checkArmStreamingBuiltin for 'sve-b16b16' (PR #109420)

2024-09-24 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm updated https://github.com/llvm/llvm-project/pull/109420 >From af4cd0b3643e682fcb34042d209df03037743eb0 Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Fri, 20 Sep 2024 14:16:23 +0100 Subject: [PATCH 1/2] [Clang][AArch64] Fix checkArmStreamingBuiltin for

[clang] [Clang][AArch64] Fix checkArmStreamingBuiltin for 'sve-b16b16' (PR #109420)

2024-09-24 Thread Sander de Smalen via cfe-commits
@@ -1802,9 +1854,29 @@ void SVEEmitter::createStreamingAttrs(raw_ostream &OS, ACLEKind Kind) { if (Def->isFlagSet(IsStreamingFlag)) StreamingMap["ArmStreaming"].insert(Def->getMangledName()); -else if (Def->isFlagSet(VerifyRuntimeMode)) +else if (Def->isFlag

[clang] [Clang][SME2] Use tuple result of SME builtins directly. (PR #109423)

2024-09-24 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm approved this pull request. https://github.com/llvm/llvm-project/pull/109423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Fix checkArmStreamingBuiltin for 'sve-b16b16' (PR #109420)

2024-09-20 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm created https://github.com/llvm/llvm-project/pull/109420 The implementation made the assumption that any feature starting with "sve" meant that this was an SVE feature. This is not the case for "sve-b16b16", as this is a feature that applies to both SVE and SME

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-25 Thread Sander de Smalen via cfe-commits
@@ -3535,6 +3536,74 @@ void CXXNameMangler::mangleExtFunctionInfo(const FunctionType *T) { // FIXME: noreturn } +enum SMEState { + Normal = 0, + SM_Enabled = 1 << 0, + SM_Compatible = 1 << 1, + ZA_Agnostic = 1 << 2, + ZA_Shift = 3, + ZT0_Shift = 6, sd

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-25 Thread Sander de Smalen via cfe-commits
@@ -3535,6 +3536,74 @@ void CXXNameMangler::mangleExtFunctionInfo(const FunctionType *T) { // FIXME: noreturn } +enum SMEState { + Normal = 0, + SM_Enabled = 1 << 0, + SM_Compatible = 1 << 1, + ZA_Agnostic = 1 << 2, + ZA_Shift = 3, + ZT0_Shift = 6, + None = 0b000, +

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-25 Thread Sander de Smalen via cfe-commits
@@ -3535,6 +3536,74 @@ void CXXNameMangler::mangleExtFunctionInfo(const FunctionType *T) { // FIXME: noreturn } +enum SMEState { + Normal = 0, sdesmalen-arm wrote: nit: I'd remove `Normal` and just keep these values for bits that would be set. https://gi

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-25 Thread Sander de Smalen via cfe-commits
@@ -3535,6 +3536,74 @@ void CXXNameMangler::mangleExtFunctionInfo(const FunctionType *T) { // FIXME: noreturn } +enum SMEState { + Normal = 0, + SM_Enabled = 1 << 0, + SM_Compatible = 1 << 1, + ZA_Agnostic = 1 << 2, + ZA_Shift = 3, + ZT0_Shift = 6, + None = 0b000, +

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-25 Thread Sander de Smalen via cfe-commits
@@ -3535,6 +3536,74 @@ void CXXNameMangler::mangleExtFunctionInfo(const FunctionType *T) { // FIXME: noreturn } +enum SMEState { sdesmalen-arm wrote: Please make this an `enum class` instead. Also, I'd recommend renaming this class so that it's clear that

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-25 Thread Sander de Smalen via cfe-commits
@@ -3535,6 +3536,74 @@ void CXXNameMangler::mangleExtFunctionInfo(const FunctionType *T) { // FIXME: noreturn } +enum SMEState { + Normal = 0, + SM_Enabled = 1 << 0, + SM_Compatible = 1 << 1, + ZA_Agnostic = 1 << 2, + ZA_Shift = 3, + ZT0_Shift = 6, + None = 0b000, +

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-25 Thread Sander de Smalen via cfe-commits
@@ -3535,6 +3536,74 @@ void CXXNameMangler::mangleExtFunctionInfo(const FunctionType *T) { // FIXME: noreturn } +enum SMEState { + Normal = 0, + SM_Enabled = 1 << 0, + SM_Compatible = 1 << 1, + ZA_Agnostic = 1 << 2, + ZA_Shift = 3, + ZT0_Shift = 6, + None = 0b000, +

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-25 Thread Sander de Smalen via cfe-commits
@@ -3535,6 +3536,74 @@ void CXXNameMangler::mangleExtFunctionInfo(const FunctionType *T) { // FIXME: noreturn } +enum SMEState { + Normal = 0, + SM_Enabled = 1 << 0, + SM_Compatible = 1 << 1, + ZA_Agnostic = 1 << 2, + ZA_Shift = 3, + ZT0_Shift = 6, + None = 0b000, +

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-25 Thread Sander de Smalen via cfe-commits
@@ -3535,6 +3536,74 @@ void CXXNameMangler::mangleExtFunctionInfo(const FunctionType *T) { // FIXME: noreturn } +enum SMEState { + Normal = 0, + SM_Enabled = 1 << 0, + SM_Compatible = 1 << 1, + ZA_Agnostic = 1 << 2, + ZA_Shift = 3, + ZT0_Shift = 6, + None = 0b000, +

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-25 Thread Sander de Smalen via cfe-commits
@@ -3535,6 +3536,74 @@ void CXXNameMangler::mangleExtFunctionInfo(const FunctionType *T) { // FIXME: noreturn } +enum SMEState { + Normal = 0, + SM_Enabled = 1 << 0, + SM_Compatible = 1 << 1, + ZA_Agnostic = 1 << 2, + ZA_Shift = 3, + ZT0_Shift = 6, + None = 0b000, +

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-29 Thread Sander de Smalen via cfe-commits
@@ -3532,6 +3533,72 @@ void CXXNameMangler::mangleExtFunctionInfo(const FunctionType *T) { // FIXME: noreturn } +enum class AAPCSBitmaskSME : unsigned { + ArmStreamingBit = 1 << 0, + ArmStreamingCompatibleBit = 1 << 1, + ArmAgnosticSMEZAStateBit = 1 << 2, + ZA_Shift = 3

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-29 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm approved this pull request. 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

[clang] [Clang][AArch64]Refactor typespec handling in SveEmitter.cpp (PR #117717)

2024-11-28 Thread Sander de Smalen via cfe-commits
@@ -423,131 +434,143 @@ const std::array SVEEmitter::Reinterprets = // Type implementation //===--===// -std::string SVEType::builtin_str() const { - std::string S; - if (isVoid()) +std::string SVEType::bu

[clang] [Clang][AArch64]Refactor typespec handling in SveEmitter.cpp (PR #117717)

2024-11-28 Thread Sander de Smalen via cfe-commits
@@ -431,133 +434,130 @@ const std::array SVEEmitter::Reinterprets = // Type implementation //===--===// -std::string SVEType::builtin_str() const { - std::string OutStr; - - if (isScalarPredicate()) -r

[clang] [Clang][AArch64]Refactor typespec handling in SveEmitter.cpp (PR #117717)

2024-11-28 Thread Sander de Smalen via cfe-commits
@@ -50,20 +50,30 @@ using TypeSpec = std::string; namespace { class SVEType { - bool Float, Signed, Immediate, Void, Constant, Pointer, BFloat, MFloat; - bool DefaultType, IsScalable, Predicate, PredicatePattern, PrefetchOp, - Svcount; + + enum TypeKind { +Void, +

[clang] [Clang][AArch64]Refactor typespec handling in SveEmitter.cpp (PR #117717)

2024-11-28 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm edited https://github.com/llvm/llvm-project/pull/117717 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64]Refactor typespec handling in SveEmitter.cpp (PR #117717)

2024-11-28 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm commented: One minor comment, but otherwise looks good! https://github.com/llvm/llvm-project/pull/117717 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-28 Thread Sander de Smalen via cfe-commits
@@ -3535,6 +3536,70 @@ void CXXNameMangler::mangleExtFunctionInfo(const FunctionType *T) { // FIXME: noreturn } +enum class AAPCSBitmaskSME : unsigned { + ArmStreamingBit = 1 << 0, + ArmStreamingCompatibleBit = 1 << 1, + ArmAgnosticSMEZAStateBit = 1 << 2, + ZA_Shift = 3

[clang] [Clang][AArch64]Refactor typespec handling in SveEmitter.cpp (PR #117717)

2024-11-27 Thread Sander de Smalen via cfe-commits
@@ -423,131 +434,143 @@ const std::array SVEEmitter::Reinterprets = // Type implementation //===--===// -std::string SVEType::builtin_str() const { - std::string S; - if (isVoid()) +std::string SVEType::bu

[clang] [Clang][AArch64]Refactor typespec handling in SveEmitter.cpp (PR #117717)

2024-11-27 Thread Sander de Smalen via cfe-commits
@@ -431,133 +434,130 @@ const std::array SVEEmitter::Reinterprets = // Type implementation //===--===// -std::string SVEType::builtin_str() const { - std::string OutStr; - - if (isScalarPredicate()) -r

[clang] [clang][SME] Ignore flatten for callees with mismatched streaming attributes (PR #116391)

2024-11-20 Thread Sander de Smalen via cfe-commits
sdesmalen-arm wrote: > Do we really need to do this in the frontend? The inliner itself should be > doing safety checks. The inliner avoids any safety checks when `alwaysinline` is specified, and this can't easily be changed (I previously raised this on [Discourse](https://discourse.llvm.org/

[clang] [clang][SME] Ignore flatten/clang::always_inline statements for callees with mismatched streaming attributes (PR #116391)

2024-11-26 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm approved this pull request. https://github.com/llvm/llvm-project/pull/116391 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64]Refactor typespec handling in SveEmitter.cpp (PR #117717)

2024-11-27 Thread Sander de Smalen via cfe-commits
@@ -424,72 +432,87 @@ const std::array SVEEmitter::Reinterprets = //===--===// std::string SVEType::builtin_str() const { - std::string S; - if (isVoid()) -return "v"; + std::string OutStr; if (i

[clang] [Clang][AArch64]Refactor typespec handling in SveEmitter.cpp (PR #117717)

2024-11-27 Thread Sander de Smalen via cfe-commits
@@ -424,72 +432,87 @@ const std::array SVEEmitter::Reinterprets = //===--===// std::string SVEType::builtin_str() const { - std::string S; - if (isVoid()) -return "v"; + std::string OutStr; if (i

[clang] [Clang][AArch64]Refactor typespec handling in SveEmitter.cpp (PR #117717)

2024-11-27 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm edited https://github.com/llvm/llvm-project/pull/117717 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64]Refactor typespec handling in SveEmitter.cpp (PR #117717)

2024-11-27 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm commented: Thanks for cleaning this up, this part was always quite messy! https://github.com/llvm/llvm-project/pull/117717 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [Clang][AArch64]Refactor typespec handling in SveEmitter.cpp (PR #117717)

2024-12-02 Thread Sander de Smalen via cfe-commits
@@ -570,27 +579,35 @@ void SVEType::applyTypespec(StringRef TS) { for (char I : TS) { switch (I) { case 'Q': + assert(Kind == Invalid && "Invalid use of modifer!"); Kind = Svcount; break; case 'P': + assert(Kind == Invalid && "Invalid use

[clang] [Clang][AArch64]Refactor typespec handling in SveEmitter.cpp (PR #117717)

2024-12-02 Thread Sander de Smalen via cfe-commits
@@ -570,27 +579,35 @@ void SVEType::applyTypespec(StringRef TS) { for (char I : TS) { switch (I) { case 'Q': + assert(Kind == Invalid && "Invalid use of modifer!"); Kind = Svcount; break; case 'P': + assert(Kind == Invalid && "Invalid use

[clang] [AArch64][SME] Fix bug on SMELd1St1 (PR #118109)

2024-12-02 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm approved this pull request. LGTM, thanks for fixing! https://github.com/llvm/llvm-project/pull/118109 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64]Refactor typespec handling in SveEmitter.cpp (PR #117717)

2024-12-02 Thread Sander de Smalen via cfe-commits
@@ -50,20 +50,30 @@ using TypeSpec = std::string; namespace { class SVEType { - bool Float, Signed, Immediate, Void, Constant, Pointer, BFloat, MFloat; - bool DefaultType, IsScalable, Predicate, PredicatePattern, PrefetchOp, - Svcount; + + enum TypeKind { +Void, +

[clang] [Clang][AArch64]Refactor typespec handling in SveEmitter.cpp (PR #117717)

2024-12-02 Thread Sander de Smalen via cfe-commits
@@ -570,27 +579,35 @@ void SVEType::applyTypespec(StringRef TS) { for (char I : TS) { switch (I) { case 'Q': + assert(Kind == Invalid && "Invalid use of modifer!"); Kind = Svcount; break; case 'P': + assert(Kind == Invalid && "Invalid use

[clang] [Clang][AArch64]Refactor typespec handling in SveEmitter.cpp (PR #117717)

2024-12-02 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm approved this pull request. Thanks, LGTM! https://github.com/llvm/llvm-project/pull/117717 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-25 Thread Sander de Smalen via cfe-commits
@@ -3536,35 +3536,64 @@ void CXXNameMangler::mangleExtFunctionInfo(const FunctionType *T) { // FIXME: noreturn } -bool hasSharedState(unsigned SMEAttrs) { +unsigned getZAState(unsigned SMEAttrs) { sdesmalen-arm wrote: nit: use the word `encode` instead of

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-25 Thread Sander de Smalen via cfe-commits
@@ -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

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-25 Thread Sander de Smalen via cfe-commits
@@ -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

[clang] [Clang][AArch64] Include SME attributes in the name mangling of function types (PR #114209)

2024-11-25 Thread Sander de Smalen via cfe-commits
@@ -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

[clang] [clang][SME] Ignore flatten/clang::always_inline statements for callees with mismatched streaming attributes (PR #116391)

2024-11-26 Thread Sander de Smalen via cfe-commits
@@ -1143,30 +1146,63 @@ void AArch64TargetCodeGenInfo::checkFunctionABI( } } -void AArch64TargetCodeGenInfo::checkFunctionCallABIStreaming( -CodeGenModule &CGM, SourceLocation CallLoc, const FunctionDecl *Caller, -const FunctionDecl *Callee) const { - if (!Caller ||

[clang] [clang][SME] Ignore flatten/clang::always_inline statements for callees with mismatched streaming attributes (PR #116391)

2024-11-26 Thread Sander de Smalen via cfe-commits
@@ -1143,30 +1146,63 @@ void AArch64TargetCodeGenInfo::checkFunctionABI( } } -void AArch64TargetCodeGenInfo::checkFunctionCallABIStreaming( -CodeGenModule &CGM, SourceLocation CallLoc, const FunctionDecl *Caller, -const FunctionDecl *Callee) const { - if (!Caller ||

[clang] [clang][SME] Ignore flatten/clang::always_inline statements for callees with mismatched streaming attributes (PR #116391)

2024-11-26 Thread Sander de Smalen via cfe-commits
@@ -1143,30 +1146,63 @@ void AArch64TargetCodeGenInfo::checkFunctionABI( } } -void AArch64TargetCodeGenInfo::checkFunctionCallABIStreaming( -CodeGenModule &CGM, SourceLocation CallLoc, const FunctionDecl *Caller, -const FunctionDecl *Callee) const { - if (!Caller ||

<    1   2   3   4   5   6   7   >