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

2024-11-29 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] [AArch64][SME] Fix bug on SMELd1St1 (PR #118109)

2024-12-02 Thread Sander de Smalen via cfe-commits
sdesmalen-arm wrote: It would be good to land this and get this cherry-picked onto the release/19.x branch. Any objection in merging this @wwwatermiao? https://github.com/llvm/llvm-project/pull/118109 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [AArch64][SME] Add diagnostics to CheckConstexprFunctionDefinition (PR #121777)

2025-01-06 Thread Sander de Smalen via cfe-commits
@@ -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

[clang] [AArch64][SME] Add diagnostics to CheckConstexprFunctionDefinition (PR #121777)

2025-01-06 Thread Sander de Smalen via cfe-commits
@@ -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 sdesmalen-arm wrote: What about this change requires c++23? https://github.com/llv

[clang] [AArch64][SME] Add diagnostics to CheckConstexprFunctionDefinition (PR #121777)

2025-01-06 Thread Sander de Smalen via cfe-commits
@@ -48,3 +48,9 @@ void streaming_compatible_def2(void (*streaming_fn_ptr)(void) __arm_streaming, // Also test when call-site is not a function. int streaming_decl_ret_int() __arm_streaming; int x = streaming_decl_ret_int(); // expected-error {{call to a streaming function req

[clang] [AArch64][Clang] Add support for __arm_agnostic("sme_za_state") (PR #121788)

2025-01-06 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm created https://github.com/llvm/llvm-project/pull/121788 This adds support for parsing the attribute and codegen to map it to "aarch64_za_state_agnostic" LLVM IR attribute. This attribute is described in the Arm C Language Extensions (ACLE) document: https:/

[clang] [clang] Emit @llvm.assume when we know the streaming mode of the function (PR #121917)

2025-01-07 Thread Sander de Smalen via cfe-commits
@@ -11335,6 +11335,13 @@ Value *CodeGenFunction::EmitAArch64SMEBuiltinExpr(unsigned BuiltinID, unsigned SMEAttrs = FPT->getAArch64SMEAttributes(); if (!(SMEAttrs & FunctionType::SME_PStateSMCompatibleMask)) { bool IsStreaming = SMEAttrs & FunctionType::SME_

[clang] [AArch64][Clang] Add support for __arm_agnostic("sme_za_state") (PR #121788)

2025-01-07 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm updated https://github.com/llvm/llvm-project/pull/121788 >From 159bc2ccdab5457d997c9fc8ed679e4607db0b79 Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Mon, 9 Sep 2024 15:20:26 +0100 Subject: [PATCH 1/2] [AArch64][Clang] Add support for __arm_agnostic("sm

[clang] [AArch64][Clang] Add support for __arm_agnostic("sme_za_state") (PR #121788)

2025-01-07 Thread Sander de Smalen via cfe-commits
@@ -7559,6 +7559,26 @@ 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

[clang] [llvm] [AArch64][SME] Disable inlining of callees with new ZT0 state (PR #121338)

2025-01-06 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm approved this pull request. LGTM as well. +1 on @MacDue's suggestion to add an extra test to sme-inline-callees-streaming-attrs.c as well. https://github.com/llvm/llvm-project/pull/121338 ___ cfe-commits mailing list c

[clang] [llvm] [AArch64][FMV] Add missing feature dependencies and detect at runtime. (PR #119231)

2024-12-11 Thread Sander de Smalen via cfe-commits
@@ -61,13 +61,13 @@ unsigned AArch64::getFMVPriority(ArrayRef Features) { return Priority + MaxFMVPriority * NumFeatures; } -uint64_t AArch64::getCpuSupportsMask(ArrayRef FeatureStrs) { - uint64_t FeaturesMask = 0; - for (const StringRef &FeatureStr : FeatureStrs) { -

[clang] [llvm] [AArch64][FMV] Add missing feature dependencies and detect at runtime. (PR #119231)

2024-12-11 Thread Sander de Smalen via cfe-commits
@@ -349,6 +349,14 @@ void AArch64::ExtensionSet::reconstructFromParsedFeatures( } } +uint64_t AArch64::ExtensionSet::toCpuSupportsMask() const { sdesmalen-arm wrote: I guess you could always move the functionality back into a separate function if future ch

[clang] [llvm] [AArch64][FMV] Add missing feature dependencies and detect at runtime. (PR #119231)

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

[clang] [llvm] [AArch64][FMV] Add missing feature dependencies and detect at runtime. (PR #119231)

2024-12-10 Thread Sander de Smalen via cfe-commits
@@ -61,13 +61,13 @@ unsigned AArch64::getFMVPriority(ArrayRef Features) { return Priority + MaxFMVPriority * NumFeatures; } -uint64_t AArch64::getCpuSupportsMask(ArrayRef FeatureStrs) { - uint64_t FeaturesMask = 0; - for (const StringRef &FeatureStr : FeatureStrs) { -

[clang] [llvm] [AArch64][FMV] Add missing feature dependencies and detect at runtime. (PR #119231)

2024-12-10 Thread Sander de Smalen via cfe-commits
@@ -349,6 +349,14 @@ void AArch64::ExtensionSet::reconstructFromParsedFeatures( } } +uint64_t AArch64::ExtensionSet::toCpuSupportsMask() const { + uint64_t FeaturesMask = 0; + for (const auto &I : getFMVInfo()) sdesmalen-arm wrote: nit: This shouldn't be

[clang] [llvm] [AArch64][FMV] Add missing feature dependencies and detect at runtime. (PR #119231)

2024-12-10 Thread Sander de Smalen via cfe-commits
@@ -61,13 +61,13 @@ unsigned AArch64::getFMVPriority(ArrayRef Features) { return Priority + MaxFMVPriority * NumFeatures; } -uint64_t AArch64::getCpuSupportsMask(ArrayRef FeatureStrs) { - uint64_t FeaturesMask = 0; - for (const StringRef &FeatureStr : FeatureStrs) { -

[clang] [llvm] [AArch64][FMV] Add missing feature dependencies and detect at runtime. (PR #119231)

2024-12-10 Thread Sander de Smalen via cfe-commits
@@ -349,6 +349,14 @@ void AArch64::ExtensionSet::reconstructFromParsedFeatures( } } +uint64_t AArch64::ExtensionSet::toCpuSupportsMask() const { sdesmalen-arm wrote: This function only has one use, perhaps just merge it into `getCpuSupportsMask`? https://g

[clang] [llvm] [clang][llvm][aarch64] Add aarch64_sme_in_streaming_mode intrinsic (PR #120265)

2024-12-17 Thread Sander de Smalen via cfe-commits
@@ -27292,6 +27294,13 @@ void AArch64TargetLowering::ReplaceNodeResults( N->getOperand(1), N->getOperand(2)); Results.push_back(DAG.getNode(ISD::TRUNCATE, DL, VT, V)); return; +} + case Intrinsic::aarch64_sme_in_streaming_mode: {

[clang] [llvm] [clang][llvm][aarch64] Add aarch64_sme_in_streaming_mode intrinsic (PR #120265)

2024-12-17 Thread Sander de Smalen via cfe-commits
@@ -1636,12 +1636,8 @@ void SVEEmitter::createSMEHeader(raw_ostream &OS) { OS << " return x0 & (1ULL << 63);\n"; OS << "}\n\n"; - OS << "__ai bool __arm_in_streaming_mode(void) __arm_streaming_compatible " -"{\n"; - OS << " uint64_t x0, x1;\n"; - OS << " __bu

[clang] [llvm] [clang][llvm][aarch64] Add aarch64_sme_in_streaming_mode intrinsic (PR #120265)

2024-12-18 Thread Sander de Smalen via cfe-commits
@@ -0,0 +1,44 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme -verify-machineinstrs < %s | FileCheck %s + + +define i1 @streaming_mode_st_compatible() #0 { +; CHECK-LABEL: streaming_mode_st_compa

[clang] [llvm] [clang][llvm][aarch64] Add aarch64_sme_in_streaming_mode intrinsic (PR #120265)

2024-12-18 Thread Sander de Smalen via cfe-commits
@@ -8,32 +8,26 @@ // CHECK-LABEL: @test_in_streaming_mode( // CHECK-NEXT: entry: -// CHECK-NEXT:[[TMP0:%.*]] = tail call aarch64_sme_preservemost_from_x2 { i64, i64 } @__arm_sme_state() #[[ATTR3:[0-9]+]] -// CHECK-NEXT:[[TMP1:%.*]] = extractvalue { i64, i64 } [[TMP0]

[clang] [llvm] [clang][llvm][aarch64] Add aarch64_sme_in_streaming_mode intrinsic (PR #120265)

2024-12-18 Thread Sander de Smalen via cfe-commits
@@ -0,0 +1,44 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme -verify-machineinstrs < %s | FileCheck %s + + +define i1 @streaming_mode_st_compatible() #0 { sdesmalen-arm wrote:

[clang] [llvm] [clang][llvm][aarch64] Add aarch64_sme_in_streaming_mode intrinsic (PR #120265)

2024-12-18 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm commented: Could you add some rationale for adding the intrinsic to the commit message? https://github.com/llvm/llvm-project/pull/120265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [llvm] [clang][llvm][aarch64] Add aarch64_sme_in_streaming_mode intrinsic (PR #120265)

2024-12-18 Thread Sander de Smalen via cfe-commits
@@ -27293,6 +27295,15 @@ void AArch64TargetLowering::ReplaceNodeResults( Results.push_back(DAG.getNode(ISD::TRUNCATE, DL, VT, V)); return; } +case Intrinsic::aarch64_sme_in_streaming_mode: { + auto DL = SDLoc(N); + SDValue Chain = DAG.getEntryNode(

[clang] [llvm] [clang][llvm][aarch64] Add aarch64_sme_in_streaming_mode intrinsic (PR #120265)

2024-12-18 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm edited https://github.com/llvm/llvm-project/pull/120265 ___ 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 aarch64_sme_in_streaming_mode intrinsic (PR #120265)

2024-12-18 Thread Sander de Smalen via cfe-commits
@@ -27293,6 +27295,15 @@ void AArch64TargetLowering::ReplaceNodeResults( Results.push_back(DAG.getNode(ISD::TRUNCATE, DL, VT, V)); return; } +case Intrinsic::aarch64_sme_in_streaming_mode: { + auto DL = SDLoc(N); sdesmalen-arm wrote: `

[clang] [llvm] [clang][llvm][aarch64] Add aarch64_sme_in_streaming_mode intrinsic (PR #120265)

2024-12-18 Thread Sander de Smalen via cfe-commits
@@ -11285,6 +11285,21 @@ Value *CodeGenFunction::EmitAArch64SMEBuiltinExpr(unsigned BuiltinID, if (Builtin->LLVMIntrinsic == 0) return nullptr; + if (BuiltinID == SME::BI__builtin_sme___arm_in_streaming_mode) { +// If we already know the streaming mode, don't bothe

[clang] [llvm] [clang][llvm][aarch64] Add aarch64_sme_in_streaming_mode intrinsic (PR #120265)

2024-12-18 Thread Sander de Smalen via cfe-commits
@@ -11285,6 +11285,21 @@ Value *CodeGenFunction::EmitAArch64SMEBuiltinExpr(unsigned BuiltinID, if (Builtin->LLVMIntrinsic == 0) return nullptr; + if (BuiltinID == SME::BI__builtin_sme___arm_in_streaming_mode) { +// If we already know the streaming mode, don't bothe

[clang] [llvm] [clang][llvm][aarch64] Add aarch64_sme_in_streaming_mode intrinsic (PR #120265)

2024-12-18 Thread Sander de Smalen via cfe-commits
@@ -11285,6 +11285,21 @@ Value *CodeGenFunction::EmitAArch64SMEBuiltinExpr(unsigned BuiltinID, if (Builtin->LLVMIntrinsic == 0) return nullptr; + if (BuiltinID == SME::BI__builtin_sme___arm_in_streaming_mode) { +// If we already know the streaming mode, don't bothe

[clang] [llvm] [clang][llvm][aarch64] Add aarch64_sme_in_streaming_mode intrinsic (PR #120265)

2024-12-18 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm edited https://github.com/llvm/llvm-project/pull/120265 ___ 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 aarch64_sme_in_streaming_mode intrinsic (PR #120265)

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

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

2024-11-21 Thread Sander de Smalen via cfe-commits
@@ -1143,30 +1146,62 @@ 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-21 Thread Sander de Smalen via cfe-commits
@@ -1143,30 +1146,62 @@ 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-21 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm commented: Thanks for including the `clang::always_inline` statement attribute as well. https://github.com/llvm/llvm-project/pull/116391 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

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

2024-11-21 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm edited 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][SME] Ignore flatten/clang::always_inline statements for callees with mismatched streaming attributes (PR #116391)

2024-11-21 Thread Sander de Smalen via cfe-commits
@@ -0,0 +1,72 @@ +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -emit-llvm -target-feature +sme %s -o - | FileCheck %s sdesmalen-arm wrote: nit: Given that the tests are otherwise identical, could you merge these with `sme-flatten-streaming-attrs.c` and def

[clang] [clang] Emit @llvm.assume before streaming_compatible functions when the streaming mode is known (PR #121917)

2025-01-08 Thread Sander de Smalen via cfe-commits
sdesmalen-arm wrote: @efriedma-quic a motivating example is https://godbolt.org/z/aW9zTrdf9 With @NickGuy-Arm's patch, this would compile to: ``` _Z1xv: rdvlx0, #1 ret _Z1yv: rdsvl x0, #1 ret ``` https://github.com/llvm/llvm-project/pull/121917 ___

[clang] [AArch64][SVE] Fold svrev(svrev(v)) to v (PR #116422)

2025-01-20 Thread Sander de Smalen via cfe-commits
@@ -1060,7 +1060,7 @@ let SVETargetGuard = "sve,bf16", SMETargetGuard = "sme,bf16" in { def SVEXT: SInst<"svext[_{d}]", "dddi", "csilUcUsUiUlhfd", MergeNone, "aarch64_sve_ext", [VerifyRuntimeMode], [ImmCheck<2, ImmCheckExtract, 1>]>; defm SVLASTA : SVEPerm<"

[clang] [clang] Lower non-builtin sincos[f|l] calls to llvm.sincos.* when -fno-math-errno is set (PR #121763)

2025-01-20 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm commented: @RKSimon do you know if there is a reason CodeGen AA is not enabled for x86? I'd otherwise be happy to approve this patch, lowering to the intrinsic seems like the right thing to do. https://github.com/llvm/llvm-project/pull/121763 __

[clang] [clang][SME] Emit error for OpemMP captured regions in streaming functions (PR #124590)

2025-01-27 Thread Sander de Smalen via cfe-commits
@@ -4568,9 +4568,23 @@ buildCapturedStmtCaptureList(Sema &S, CapturedRegionScopeInfo *RSI, return false; } +static bool +isOpenMPCapturedRegionInArmStreamingFunction(Sema const &S, + CapturedRegionKind Kind) { + if (!S.getLangOpt

[clang] [AArch64] Enable vscale_range with +sme (PR #124466)

2025-01-28 Thread Sander de Smalen via cfe-commits
@@ -708,7 +708,7 @@ AArch64TargetInfo::getVScaleRange(const LangOptions &LangOpts) const { return std::pair( LangOpts.VScaleMin ? LangOpts.VScaleMin : 1, LangOpts.VScaleMax); - if (hasFeature("sve")) + if (hasFeature("sve") || hasFeature("sme"))

[clang] [clang][SME] Emit error for OpenMP captured regions in SME functions (PR #124590)

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

[clang] [clang][SME] Account for C++ lambdas in SME builtin diagnostics (PR #124750)

2025-01-28 Thread Sander de Smalen via cfe-commits
@@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve \ sdesmalen-arm wrote: Maybe it makes more sense to move the existing `aarch64-incompat-sm-builtin-calls.c` to `aarch64-incompat-sm-builtin-calls.cpp` (there is nothing C-

[clang] [clang][SME] Account for C++ lambdas in SME builtin diagnostics (PR #124750)

2025-01-28 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-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

[clang] [AArch64] Add MSVC mangling for the __mfp8 type (PR #124968)

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

[clang] [AArch64][Clang] Add support for __arm_agnostic("sme_za_state") (PR #121788)

2025-01-12 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm updated https://github.com/llvm/llvm-project/pull/121788 >From 4e2166f1c19246e3fb5074da466d151070b5606c Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Mon, 9 Sep 2024 15:20:26 +0100 Subject: [PATCH 1/4] [AArch64][Clang] Add support for __arm_agnostic("sm

[clang] 08028d6 - [Clang] Fix buildbot failure introduced by #121788

2025-01-12 Thread Sander de Smalen via cfe-commits
Author: Sander de Smalen Date: 2025-01-12T22:09:26Z New Revision: 08028d68a90bbc47464562a745e33fa10256a7d3 URL: https://github.com/llvm/llvm-project/commit/08028d68a90bbc47464562a745e33fa10256a7d3 DIFF: https://github.com/llvm/llvm-project/commit/08028d68a90bbc47464562a745e33fa10256a7d3.diff L

[clang] [AArch64][Clang] Add support for __arm_agnostic("sme_za_state") (PR #121788)

2025-01-12 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm closed 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

[clang] [Clang] Add AArch64 SME changes to release notes (NFC) (PR #122899)

2025-01-14 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm edited 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

[clang] [Clang] Add AArch64 SME changes to release notes (NFC) (PR #122899)

2025-01-14 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm closed 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

[clang] [Clang] Add AArch64 SME changes to the release notes (PR #122899)

2025-01-14 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm created https://github.com/llvm/llvm-project/pull/122899 None >From e5c0686058f5dac17b02547e283df9bd20d24cae Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Tue, 14 Jan 2025 13:23:54 + Subject: [PATCH] [Clang] Add AArch64 SME changes to the release no

[clang] [Clang] Add AArch64 SME changes to the release notes (PR #122899)

2025-01-14 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm updated https://github.com/llvm/llvm-project/pull/122899 >From 0218a54ea332dc77a95e887fc5c83ffe9b47d0b8 Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Tue, 14 Jan 2025 13:23:54 + Subject: [PATCH] [Clang] Add AArch64 SME changes to the release notes -

[clang] [clang] Emit @llvm.assume before streaming_compatible functions when the streaming mode is known (PR #121917)

2025-01-10 Thread Sander de Smalen via cfe-commits
sdesmalen-arm wrote: The assumption cache mechanism is used by a number of passes, such as [partial] inlining, function specialization and IPSCCP (interprocedural sparse conditional constant propagation). The idea behind doing this is to let optimizations iteratively apply knowledge about the

[clang] [AArch64][SME] Add diagnostics for SME attributes on lambda functions (PR #121777)

2025-01-09 Thread Sander de Smalen via cfe-commits
@@ -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

[clang] [AArch64][SME] Add diagnostics for SME attributes on lambda functions (PR #121777)

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

[clang] [AArch64][Clang] Add support for __arm_agnostic("sme_za_state") (PR #121788)

2025-01-08 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm updated https://github.com/llvm/llvm-project/pull/121788 >From 159bc2ccdab5457d997c9fc8ed679e4607db0b79 Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Mon, 9 Sep 2024 15:20:26 +0100 Subject: [PATCH 1/3] [AArch64][Clang] Add support for __arm_agnostic("sm

[clang] [clang] Emit @llvm.assume before streaming_compatible functions when the streaming mode is known (PR #121917)

2025-01-08 Thread Sander de Smalen via cfe-commits
@@ -1275,6 +1279,31 @@ bool AArch64TargetCodeGenInfo::wouldInliningViolateFunctionCallABI( GetArmSMEInlinability(Caller, Callee) != ArmSMEInlinability::Ok; } +void AArch64TargetCodeGenInfo::emitFunctionCallProlog( +CGBuilderTy &Builder, const FunctionDecl *Caller

[clang] [clang] Emit @llvm.assume before streaming_compatible functions when the streaming mode is known (PR #121917)

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

[clang] [clang] Emit @llvm.assume before streaming_compatible functions when the streaming mode is known (PR #121917)

2025-01-08 Thread Sander de Smalen via cfe-commits
@@ -1275,6 +1279,31 @@ bool AArch64TargetCodeGenInfo::wouldInliningViolateFunctionCallABI( GetArmSMEInlinability(Caller, Callee) != ArmSMEInlinability::Ok; } +void AArch64TargetCodeGenInfo::emitFunctionCallProlog( +CGBuilderTy &Builder, const FunctionDecl *Caller

[clang] [clang] Emit @llvm.assume before streaming_compatible functions when the streaming mode is known (PR #121917)

2025-01-08 Thread Sander de Smalen via cfe-commits
@@ -1275,6 +1279,31 @@ bool AArch64TargetCodeGenInfo::wouldInliningViolateFunctionCallABI( GetArmSMEInlinability(Caller, Callee) != ArmSMEInlinability::Ok; } +void AArch64TargetCodeGenInfo::emitFunctionCallProlog( +CGBuilderTy &Builder, const FunctionDecl *Caller

[clang] [clang] Emit @llvm.assume before streaming_compatible functions when the streaming mode is known (PR #121917)

2025-01-08 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm commented: @NickGuy-Arm this PR is missing some test-coverage. @efriedma-quic do you have any thoughts on emitting the llvm.assume as a prologue to the actual call? I guess the alternative would be to analyse the function to see if there's any calls to streamin

[clang] [llvm] [Arch64][SVE] Lower svrev_* to llvm.vector.reverse and fold svrev(svrev(x)) -> x (PR #116422)

2025-02-13 Thread Sander de Smalen via cfe-commits
@@ -21962,6 +21962,35 @@ SDValue tryLowerPartialReductionToWideAdd(SDNode *N, return DAG.getNode(TopOpcode, DL, AccVT, BottomNode, ExtOp); } +static SDValue foldRevInvolution(SDNode *N) { + SDValue InnerRev = N->getOperand(1); + if (!InnerRev.hasOneUse()) +return SDVal

[clang] [llvm] [Arch64][SVE] Lower svrev_* to llvm.vector.reverse and fold svrev(svrev(x)) -> x (PR #116422)

2025-02-13 Thread Sander de Smalen via cfe-commits
@@ -21962,6 +21962,35 @@ SDValue tryLowerPartialReductionToWideAdd(SDNode *N, return DAG.getNode(TopOpcode, DL, AccVT, BottomNode, ExtOp); } +static SDValue foldRevInvolution(SDNode *N) { + SDValue InnerRev = N->getOperand(1); + if (!InnerRev.hasOneUse()) +return SDVal

[clang] [llvm] [Arch64][SVE] Lower svrev_* to llvm.vector.reverse and fold svrev(svrev(x)) -> x (PR #116422)

2025-02-13 Thread Sander de Smalen via cfe-commits
@@ -22270,6 +22299,15 @@ static SDValue performIntrinsicCombine(SDNode *N, return tryConvertSVEWideCompare(N, ISD::SETULT, DCI, DAG); case Intrinsic::aarch64_sve_cmpls_wide: return tryConvertSVEWideCompare(N, ISD::SETULE, DCI, DAG); + case Intrinsic::aarch64_sve_rev:

[clang] [clang] Add `__builtin_sincospi` that lowers to `llvm.sincospi.*` (PR #127065)

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

[clang] [llvm] [LLVM][SROA] Teach SROA how to "bitcast" between fixed and scalable vectors. (PR #130973)

2025-04-10 Thread Sander de Smalen via cfe-commits
@@ -1990,21 +2028,56 @@ static bool canConvertValue(const DataLayout &DL, Type *OldTy, Type *NewTy) { static Value *convertValue(const DataLayout &DL, IRBuilderTy &IRB, Value *V, Type *NewTy) { Type *OldTy = V->getType(); - assert(canConvertValue(

[clang] [llvm] [LLVM][SROA] Teach SROA how to "bitcast" between fixed and scalable vectors. (PR #130973)

2025-04-10 Thread Sander de Smalen via cfe-commits
@@ -554,6 +554,22 @@ class VectorType : public Type { return VectorType::get(VTy->getElementType(), EltCnt * 2); } + /// This static method returns a VectorType with the same size-in-bits as + /// SizeTy but with an element type that matches the scalar type of EltTy. +

<    2   3   4   5   6   7