[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] [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-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); }

[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

[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
@@ -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

[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 , case AArch64::COALESCER_BARRIER_FPR128: MI.eraseFromParent(); return true; + case AArch64::VGSavePseudo: + case AArch64::VGRestorePseudo: { + MachineFunction =

[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
@@ -8443,9 +8452,16 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo , 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
@@ -1552,6 +1553,57 @@ bool AArch64ExpandPseudo::expandMI(MachineBasicBlock , case AArch64::COALESCER_BARRIER_FPR128: MI.eraseFromParent(); return true; + case AArch64::VGSavePseudo: + case AArch64::VGRestorePseudo: { + MachineFunction =

[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 , case AArch64::COALESCER_BARRIER_FPR128: MI.eraseFromParent(); return true; + case AArch64::VGSavePseudo: + case AArch64::VGRestorePseudo: { + MachineFunction =

[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 , SDValue InGlue; if (RequiresSMChange) { + +if (Subtarget->hasSVE()) { sdesmalen-arm wrote: I think we can only emit this pseudo when we have asynchronous unwind tables

[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 , case AArch64::COALESCER_BARRIER_FPR128: MI.eraseFromParent(); return true; + case AArch64::VGSavePseudo: + case AArch64::VGRestorePseudo: { + MachineFunction =

[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 , case AArch64::COALESCER_BARRIER_FPR128: MI.eraseFromParent(); return true; + case AArch64::VGSavePseudo: + case AArch64::VGRestorePseudo: { + MachineFunction =

[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] [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] [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

[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

[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

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

2024-04-24 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] [libcxx] [lld] [llvm] Triple::normalize: Set OS for 3-component triple with none as middle (PR #89638)

2024-04-23 Thread Sander de Smalen via cfe-commits
@@ -1149,6 +1149,13 @@ std::string Triple::normalize(StringRef Str) { } } + // For 3-component triples, the middle component is used to set Vendor; + // while if it is "none", we'd prefer to set OS. + // This is for some baremetal cases, such as "arm-none-elf". + if

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

2024-04-12 Thread Sander de Smalen via cfe-commits
@@ -3756,12 +3756,11 @@ def err_sme_definition_using_za_in_non_sme_target : Error< def err_sme_definition_using_zt0_in_non_sme2_target : Error< "function using ZT0 state requires 'sme2'">; def warn_sme_streaming_pass_return_vl_to_non_streaming : Warning< - "passing a

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

2024-04-12 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm commented: Left two nits, but otherwise looks good. 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] Extend diagnostics when warning non/streaming about … (PR #88380)

2024-04-12 Thread Sander de Smalen via cfe-commits
@@ -3756,12 +3756,11 @@ def err_sme_definition_using_za_in_non_sme_target : Error< def err_sme_definition_using_zt0_in_non_sme2_target : Error< "function using ZT0 state requires 'sme2'">; def warn_sme_streaming_pass_return_vl_to_non_streaming : Warning< - "passing a

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

2024-04-12 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm edited 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] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-03-25 Thread Sander de Smalen via cfe-commits
@@ -3717,6 +3717,16 @@ def err_sme_definition_using_za_in_non_sme_target : Error< "function using ZA state requires 'sme'">; def err_sme_definition_using_zt0_in_non_sme2_target : Error< "function using ZT0 state requires 'sme2'">; +def

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-03-25 Thread Sander de Smalen via cfe-commits
@@ -1390,6 +1390,9 @@ def MultiGPU: DiagGroup<"multi-gpu">; // libc and the CRT to be skipped. def AVRRtlibLinkingQuirks : DiagGroup<"avr-rtlib-linking-quirks">; +// A warning group AArch64 related to SME function attribues. sdesmalen-arm wrote: nit: Sorry,

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-03-25 Thread Sander de Smalen via cfe-commits
@@ -7516,28 +7516,23 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } -auto *CallerFD = dyn_cast(CurContext); -bool IsCalleeStreaming = -(ExtInfo.AArch64SMEAttributes & FunctionType::SME_PStateSMEnabledMask); -bool

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-03-19 Thread Sander de Smalen via cfe-commits
@@ -7516,28 +7516,23 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } -auto *CallerFD = dyn_cast(CurContext); -bool IsCalleeStreaming = -(ExtInfo.AArch64SMEAttributes & FunctionType::SME_PStateSMEnabledMask); -bool

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-03-19 Thread Sander de Smalen via cfe-commits
@@ -3723,8 +3723,8 @@ def warn_sme_streaming_pass_return_vl_to_non_streaming : Warning< " different">, InGroup, DefaultIgnore; def warn_sme_locally_streaming_has_vl_args_returns : Warning< - "passing/returning a VL-dependent argument from a function" - "

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-03-19 Thread Sander de Smalen via cfe-commits
@@ -7513,6 +7516,30 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } +auto *CallerFD = dyn_cast(CurContext); +bool IsCalleeStreaming = +(ExtInfo.AArch64SMEAttributes & FunctionType::SME_PStateSMEnabledMask); +bool

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-03-19 Thread Sander de Smalen via cfe-commits
@@ -7513,6 +7516,30 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } +auto *CallerFD = dyn_cast(CurContext); +bool IsCalleeStreaming = +(ExtInfo.AArch64SMEAttributes & FunctionType::SME_PStateSMEnabledMask); +bool

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-03-19 Thread Sander de Smalen via cfe-commits
@@ -7513,6 +7516,30 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } +auto *CallerFD = dyn_cast(CurContext); +bool IsCalleeStreaming = +(ExtInfo.AArch64SMEAttributes & FunctionType::SME_PStateSMEnabledMask); +bool

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-03-19 Thread Sander de Smalen via cfe-commits
@@ -7513,6 +7516,30 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } +auto *CallerFD = dyn_cast(CurContext); +bool IsCalleeStreaming = +(ExtInfo.AArch64SMEAttributes & FunctionType::SME_PStateSMEnabledMask);

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-03-19 Thread Sander de Smalen via cfe-commits
@@ -7513,6 +7516,30 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } +auto *CallerFD = dyn_cast(CurContext); sdesmalen-arm wrote: nit: move this closer to its use, preferably wrap the condition, e.g. ``` if (auto

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-03-19 Thread Sander de Smalen via cfe-commits
@@ -7513,6 +7516,30 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } +auto *CallerFD = dyn_cast(CurContext); +bool IsCalleeStreaming = +(ExtInfo.AArch64SMEAttributes & FunctionType::SME_PStateSMEnabledMask); +bool

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-03-19 Thread Sander de Smalen via cfe-commits
@@ -7513,6 +7516,30 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } +auto *CallerFD = dyn_cast(CurContext); +bool IsCalleeStreaming = +(ExtInfo.AArch64SMEAttributes & FunctionType::SME_PStateSMEnabledMask); +bool

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-03-19 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm commented: Thanks for the update. I just left a few more suggestions to clean up the code a bit. https://github.com/llvm/llvm-project/pull/79842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

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

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-03-19 Thread Sander de Smalen via cfe-commits
@@ -3717,6 +3717,16 @@ def err_sme_definition_using_za_in_non_sme_target : Error< "function using ZA state requires 'sme'">; def err_sme_definition_using_zt0_in_non_sme2_target : Error< "function using ZT0 state requires 'sme2'">; +def

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-03-04 Thread Sander de Smalen via cfe-commits
@@ -7513,6 +7516,36 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } +auto *CallerFD = dyn_cast(CurContext); +bool IsCalleeStreaming = +(ExtInfo.AArch64SMEAttributes & FunctionType::SME_PStateSMEnabledMask); +bool

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-03-04 Thread Sander de Smalen via cfe-commits
@@ -7531,19 +7531,15 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, // vector lengths may be different. if (CallerFD && Context.getTargetInfo().hasFeature("sme") && !IsBuiltin) { ArmStreamingType CallerFnType =

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-29 Thread Sander de Smalen via cfe-commits
@@ -3717,6 +3717,16 @@ def err_sme_definition_using_za_in_non_sme_target : Error< "function using ZA state requires 'sme'">; def err_sme_definition_using_zt0_in_non_sme2_target : Error< "function using ZT0 state requires 'sme2'">; +def

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-29 Thread Sander de Smalen via cfe-commits
@@ -7513,6 +7516,36 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } +auto *CallerFD = dyn_cast(CurContext); +bool IsCalleeStreaming = +(ExtInfo.AArch64SMEAttributes & FunctionType::SME_PStateSMEnabledMask); +bool

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-29 Thread Sander de Smalen via cfe-commits
@@ -12230,12 +12230,22 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, } // Check if the function definition uses any AArch64 SME features without - // having the '+sme' feature enabled. + // having the '+sme' feature enabled and warn user if sme

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-29 Thread Sander de Smalen via cfe-commits
@@ -3717,6 +3717,16 @@ def err_sme_definition_using_za_in_non_sme_target : Error< "function using ZA state requires 'sme'">; def err_sme_definition_using_zt0_in_non_sme2_target : Error< "function using ZT0 state requires 'sme2'">; +def

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-29 Thread Sander de Smalen via cfe-commits
@@ -7513,6 +7516,36 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } +auto *CallerFD = dyn_cast(CurContext); +bool IsCalleeStreaming = +(ExtInfo.AArch64SMEAttributes & FunctionType::SME_PStateSMEnabledMask); +bool

[clang] [llvm] [LLVM][TypeSize] Remove default constructor. (PR #82810)

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

[clang] [AArch64][SME2] Refactor arm_sme.td into multiclasses (PR #78169)

2024-02-23 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm requested changes to this pull request. There isn't that much commonality factored out by these multi-classes as I had initially hoped, but I can understand why it's difficult to group these together in a better way. Given the above and the fact that the

[clang] 3b3d097 - [Clang] Fix acle_sme_zero.c once more.

2024-02-23 Thread Sander de Smalen via cfe-commits
Author: Sander de Smalen Date: 2024-02-23T12:13:14Z New Revision: 3b3d0978c334702114131e4dab549aa25b9f0ad4 URL: https://github.com/llvm/llvm-project/commit/3b3d0978c334702114131e4dab549aa25b9f0ad4 DIFF: https://github.com/llvm/llvm-project/commit/3b3d0978c334702114131e4dab549aa25b9f0ad4.diff

[clang] cdf19d1 - [Clang] Fix acle_sme_zero.c (missing aarch64-registered-target)

2024-02-23 Thread Sander de Smalen via cfe-commits
Author: Sander de Smalen Date: 2024-02-23T11:43:55Z New Revision: cdf19d13bf39f0679c3636eada87a5645f9a4c84 URL: https://github.com/llvm/llvm-project/commit/cdf19d13bf39f0679c3636eada87a5645f9a4c84 DIFF: https://github.com/llvm/llvm-project/commit/cdf19d13bf39f0679c3636eada87a5645f9a4c84.diff

[clang] [Clang][AArch64] Add missing prototypes for streaming-compatible routines (PR #82649)

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

[clang] [Clang][AArch64] Fix 'svzero_za' intrinsic to take no arguments. (PR #82648)

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

[clang] [Clang][AArch64] Add missing prototypes for streaming-compatible routines (PR #82649)

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

[clang] [Clang][AArch64] Add missing prototypes for streaming-compatible routines (PR #82649)

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

[clang] [Clang][AArch64] Add missing prototypes for streaming-compatible rout… (PR #82649)

2024-02-22 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm created https://github.com/llvm/llvm-project/pull/82649 …ines >From 6b75aabe4e098d5faef01cacb5b00e5b59231a3b Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Wed, 21 Feb 2024 12:23:21 + Subject: [PATCH] [Clang][AArch64] Add missing prototypes for

[clang] [Clang][AArch64] Fix 'svzero_za' intrinsic to take no arguments. (PR #82648)

2024-02-22 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm created https://github.com/llvm/llvm-project/pull/82648 We previously defined svzero_za as: void svzero_za(); rather than: void svzero_za(void); Which meant that Clang accepted arguments. Compiling for example `svzero_za()` ended up with incorrect IR

[clang] [llvm] [Clang][SME] Detect always_inline used with mismatched streaming attributes (PR #77936)

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

[clang] [llvm] [Clang][SME] Detect always_inline used with mismatched streaming attributes (PR #77936)

2024-02-22 Thread Sander de Smalen via cfe-commits
@@ -814,6 +820,43 @@ Address AArch64ABIInfo::EmitMSVAArg(CodeGenFunction , Address VAListAddr, /*allowHigherAlign*/ false); } +static bool isStreaming(const FunctionDecl *F) { + if (F->hasAttr()) +return true; + if (const auto *T =

[clang] [llvm] [Clang][SME] Detect always_inline used with mismatched streaming attributes (PR #77936)

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

[clang] [llvm] [Clang][SME] Detect always_inline used with mismatched streaming attributes (PR #77936)

2024-02-21 Thread Sander de Smalen via cfe-commits
@@ -814,6 +820,43 @@ Address AArch64ABIInfo::EmitMSVAArg(CodeGenFunction , Address VAListAddr, /*allowHigherAlign*/ false); } +static bool isStreaming(const FunctionDecl *F) { + if (F->hasAttr()) +return true; + if (const auto *T =

[clang] [llvm] [Clang][SME] Detect always_inline used with mismatched streaming attributes (PR #77936)

2024-02-21 Thread Sander de Smalen via cfe-commits
@@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -S -target-feature +sme -verify -DTEST_NONE -x c %s sdesmalen-arm wrote: Doing `-x c` on a .c file is redundant, as it's already interpreted as a C source file.

[clang] [llvm] [Clang][SME] Detect always_inline used with mismatched streaming attributes (PR #77936)

2024-02-21 Thread Sander de Smalen via cfe-commits
@@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -S -target-feature +sme -verify -DTEST_NONE -x c %s +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -S -target-feature +sme -verify -DTEST_COMPATIBLE -x c %s +// RUN: %clang_cc1 -triple

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-14 Thread Sander de Smalen via cfe-commits
@@ -7513,6 +7516,41 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } +auto *CallerFD = dyn_cast(CurContext); +bool IsCalleeStreaming = ((ExtInfo.AArch64SMEAttributes & +

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-14 Thread Sander de Smalen via cfe-commits
@@ -12239,7 +12239,8 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (UsesSM) { sdesmalen-arm wrote: The comment on line 12232-12233 needs an update. https://github.com/llvm/llvm-project/pull/79842

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-14 Thread Sander de Smalen via cfe-commits
@@ -12236,6 +12236,23 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, bool UsesSM = NewFD->hasAttr(); bool UsesZA = Attr && Attr->isNewZA(); bool UsesZT0 = Attr && Attr->isNewZT0(); + +if (UsesSM) { + if

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-14 Thread Sander de Smalen via cfe-commits
@@ -445,3 +448,54 @@ void conflicting_state_attrs_preserves_out_zt0(void) __arm_preserves("zt0") __ar // expected-cpp-error@+2 {{conflicting attributes for state 'zt0'}} // expected-error@+1 {{conflicting attributes for state 'zt0'}} void

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-14 Thread Sander de Smalen via cfe-commits
@@ -12236,6 +12236,23 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, bool UsesSM = NewFD->hasAttr(); bool UsesZA = Attr && Attr->isNewZA(); bool UsesZT0 = Attr && Attr->isNewZT0(); + +if (UsesSM) { + if

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-14 Thread Sander de Smalen via cfe-commits
@@ -7513,6 +7516,41 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } +auto *CallerFD = dyn_cast(CurContext); +bool IsCalleeStreaming = ((ExtInfo.AArch64SMEAttributes & +

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-14 Thread Sander de Smalen via cfe-commits
@@ -3717,6 +3717,14 @@ def err_sme_definition_using_za_in_non_sme_target : Error< "function using ZA state requires 'sme'">; def err_sme_definition_using_zt0_in_non_sme2_target : Error< "function using ZT0 state requires 'sme2'">; +def

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-14 Thread Sander de Smalen via cfe-commits
@@ -7517,34 +7517,37 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } auto *CallerFD = dyn_cast(CurContext); -if (FD && CallerFD && Context.getTargetInfo().hasFeature("sme") && -!FD->getBuiltinID()) { +bool IsCalleeStreaming

[clang] [IRGen][AArch64][RISCV] Generalize bitcast between i1 predicate vector and i8 fixed vector. (PR #76548)

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

[clang] [llvm] [Clang][SME] Detect always_inline used with mismatched streaming attributes (PR #77936)

2024-02-13 Thread Sander de Smalen via cfe-commits
@@ -0,0 +1,7 @@ +// RUN: %clang --target=aarch64-none-linux-gnu -march=armv9-a+sme -O3 -S -Xclang -verify %s sdesmalen-arm wrote: You can remove `-O3` because clang doesn't do any codegen when it has `-verify`. https://github.com/llvm/llvm-project/pull/77936

[clang] [llvm] [Clang][SME] Detect always_inline used with mismatched streaming attributes (PR #77936)

2024-02-13 Thread Sander de Smalen via cfe-commits
@@ -0,0 +1,6 @@ +// RUN: %clang --target=aarch64-none-linux-gnu -march=armv9-a+sme -O3 -S -Xclang -verify %s sdesmalen-arm wrote: Can you merge all these tests into a single file? https://github.com/llvm/llvm-project/pull/77936

[clang] [llvm] [Clang][SME] Detect always_inline used with mismatched streaming attributes (PR #77936)

2024-02-13 Thread Sander de Smalen via cfe-commits
@@ -279,6 +279,12 @@ def err_builtin_needs_feature : Error<"%0 needs target feature %1">; def err_function_needs_feature : Error< "always_inline function %1 requires target feature '%2', but would " "be inlined into function %0 that is compiled without support for '%2'">;

[clang] [llvm] [Clang][SME] Detect always_inline used with mismatched streaming attributes (PR #77936)

2024-02-13 Thread Sander de Smalen via cfe-commits
@@ -814,6 +820,49 @@ Address AArch64ABIInfo::EmitMSVAArg(CodeGenFunction , Address VAListAddr, /*allowHigherAlign*/ false); } +class SMEAttributes { +public: + bool IsStreaming = false; + bool IsStreamingCompatible = false; + bool HasNewZA =

[clang] [llvm] [Clang][SME] Detect always_inline used with mismatched streaming attributes (PR #77936)

2024-02-13 Thread Sander de Smalen via cfe-commits
@@ -0,0 +1,13 @@ +// RUN: %clang --target=aarch64-none-linux-gnu -march=armv9-a+sme -O3 -S -Xclang -verify %s + +// Conflicting attributes when using always_inline +__attribute__((always_inline)) sdesmalen-arm wrote: nit: To simplify the test, could you do

[clang] [llvm] [Clang][SME] Detect always_inline used with mismatched streaming attributes (PR #77936)

2024-02-13 Thread Sander de Smalen via cfe-commits
@@ -814,6 +820,49 @@ Address AArch64ABIInfo::EmitMSVAArg(CodeGenFunction , Address VAListAddr, /*allowHigherAlign*/ false); } +class SMEAttributes { sdesmalen-arm wrote: I'd like to avoid adding another `SMEAttributes class`. Could

[clang] [clang][sema][FMV] Forbid multi-versioning arm_streaming functions. (PR #81268)

2024-02-12 Thread Sander de Smalen via cfe-commits
@@ -3501,9 +3501,16 @@ bool Sema::checkTargetAttr(SourceLocation LiteralLoc, StringRef AttrStr) { return false; } +static bool hasStreamingModeChangeInABI(const FunctionDecl *FD) { sdesmalen-arm wrote: nit: ```suggestion static bool

[clang] [clang][sema][FMV] Forbid multi-versioning arm_streaming functions. (PR #81268)

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

[clang] [clang][sema][FMV] Forbid multi-versioning arm_streaming functions. (PR #81268)

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

[clang] [clang][sema][FMV] Forbid multi-versioning arm_streaming functions. (PR #81268)

2024-02-09 Thread Sander de Smalen via cfe-commits
@@ -3501,9 +3501,18 @@ bool Sema::checkTargetAttr(SourceLocation LiteralLoc, StringRef AttrStr) { return false; } +static bool isArmStreaming(const FunctionDecl *FD) { + if (FD->hasAttr()) +return true; sdesmalen-arm wrote: Is this check required? I

[clang] [clang][sema][FMV] Forbid multi-versioning arm_streaming functions. (PR #81268)

2024-02-09 Thread Sander de Smalen via cfe-commits
@@ -454,3 +454,34 @@ void unimplemented_spill_fill_za(void (*share_zt0_only)(void) __arm_inout("zt0") // expected-note@+1 {{add '__arm_preserves("za")' to the callee if it preserves ZA}} share_zt0_only(); } + +// expected-cpp-error@+2 {{streaming function cannot be

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-09 Thread Sander de Smalen via cfe-commits
@@ -7513,6 +7516,38 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } +auto *CallerFD = dyn_cast(CurContext); +if (FD && CallerFD && Context.getTargetInfo().hasFeature("sme") && sdesmalen-arm wrote: This code

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-09 Thread Sander de Smalen via cfe-commits
@@ -445,3 +448,54 @@ void conflicting_state_attrs_preserves_out_zt0(void) __arm_preserves("zt0") __ar // expected-cpp-error@+2 {{conflicting attributes for state 'zt0'}} // expected-error@+1 {{conflicting attributes for state 'zt0'}} void

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-09 Thread Sander de Smalen via cfe-commits
@@ -3717,6 +3717,30 @@ def err_sme_definition_using_za_in_non_sme_target : Error< "function using ZA state requires 'sme'">; def err_sme_definition_using_zt0_in_non_sme2_target : Error< "function using ZT0 state requires 'sme2'">; +def

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-09 Thread Sander de Smalen via cfe-commits
@@ -7513,6 +7516,38 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } +auto *CallerFD = dyn_cast(CurContext); +if (FD && CallerFD && Context.getTargetInfo().hasFeature("sme") && +!FD->getBuiltinID()) { + // If the

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-09 Thread Sander de Smalen via cfe-commits
@@ -3717,6 +3717,30 @@ def err_sme_definition_using_za_in_non_sme_target : Error< "function using ZA state requires 'sme'">; def err_sme_definition_using_zt0_in_non_sme2_target : Error< "function using ZT0 state requires 'sme2'">; +def

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-08 Thread Sander de Smalen via cfe-commits
@@ -3717,6 +3717,30 @@ def err_sme_definition_using_za_in_non_sme_target : Error< "function using ZA state requires 'sme'">; def err_sme_definition_using_zt0_in_non_sme2_target : Error< "function using ZT0 state requires 'sme2'">; +def

[clang] [Clang][AArch64] Fix some target guards and remove +sve from tests. (PR #80681)

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

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-02 Thread Sander de Smalen via cfe-commits
@@ -7513,6 +7516,44 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } +auto *CallerFD = dyn_cast(CurContext); +if (FD && CallerFD && Context.getTargetInfo().hasFeature("sme") && +!FD->getBuiltinID()) { + // If the

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-02 Thread Sander de Smalen via cfe-commits
@@ -1,5 +1,6 @@ -// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -fsyntax-only -verify %s -// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -fsyntax-only -verify=expected-cpp -x c++ %s +// RUN: %clang_cc1 -triple

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-02 Thread Sander de Smalen via cfe-commits
@@ -7513,6 +7516,44 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, } } +auto *CallerFD = dyn_cast(CurContext); +if (FD && CallerFD && Context.getTargetInfo().hasFeature("sme") && +!FD->getBuiltinID()) { + // If the

[clang] [Clang][AArch64] Warn when calling streaming/non-streaming about vect… (PR #79842)

2024-02-02 Thread Sander de Smalen via cfe-commits
@@ -3717,6 +3717,30 @@ def err_sme_definition_using_za_in_non_sme_target : Error< "function using ZA state requires 'sme'">; def err_sme_definition_using_zt0_in_non_sme2_target : Error< "function using ZT0 state requires 'sme2'">; +def

[clang] [Clang][AArch64] Emit 'unimplemented' diagnostic for SME (PR #80295)

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

[clang] [IRGen][AArch64][RISCV] Generalize bitcast between i1 predicate vector and i8 fixed vector. (PR #76548)

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

[clang] [IRGen][AArch64][RISCV] Generalize bitcast between i1 predicate vector and i8 fixed vector. (PR #76548)

2024-02-02 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm commented: Generalising this code makes sense, 16 should never have been hardcoded here. Is it possible to add a test for the case where the predicate type is not ``? > Though I do wonder if we have the bitcast on the wrong side. Maybe we should > be casting

[clang] [IRGen][AArch64][RISCV] Generalize bitcast between i1 predicate vector and i8 fixed vector. (PR #76548)

2024-02-02 Thread Sander de Smalen via cfe-commits
@@ -2136,14 +2136,16 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { // bitcast. if (const auto *FixedSrc = dyn_cast(SrcTy)) { if (const auto *ScalableDst = dyn_cast(DstTy)) { -// If we are casting a fixed i8 vector to a scalable 16 x i1

[clang] [IRGen][AArch64][RISCV] Generalize bitcast between i1 predicate vector and i8 fixed vector. (PR #76548)

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

[clang] [Clang][AArch64] Add missing SME macros (PR #80293)

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

  1   2   3   4   5   >