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

2025-01-06 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue created https://github.com/llvm/llvm-project/pull/121763 This will allow vectorizing these calls (after a few more patches). This should not change the codegen for targets that enable the use of AA during the codegen (in `TargetSubtargetInfo::useAA()`). This includes

[clang] [clang] Support member function poiners in Decl::getFunctionType() (PR #125077)

2025-01-31 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue updated https://github.com/llvm/llvm-project/pull/125077 >From 620bb22d1b44f3c60e15d2847fdcfd3dd9aafa51 Mon Sep 17 00:00:00 2001 From: Benjamin Maxwell Date: Thu, 30 Jan 2025 15:08:24 + Subject: [PATCH 1/2] [clang] Support member function poiners in Decl::getFunct

[clang] [clang] Support member function poiners in Decl::getFunctionType() (PR #125077)

2025-01-31 Thread Benjamin Maxwell via cfe-commits
MacDue wrote: > Maybe the description here should more explicitly state that it looks for > function pointers as well as functions... > > > Good idea :+1: I've attempted to clarify what this function does now (in the doc comment). > Probably we should fix the error message not to mention K&

[clang] [clang] Support member function poiners in Decl::getFunctionType() (PR #125077)

2025-01-31 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue edited https://github.com/llvm/llvm-project/pull/125077 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Support member function poiners in Decl::getFunctionType() (PR #125077)

2025-02-05 Thread Benjamin Maxwell via cfe-commits
MacDue wrote: /cherry-pick https://github.com/llvm/llvm-project/commit/692c9b210728323ac499a402ee6eb901f35856f2 https://github.com/llvm/llvm-project/pull/125077 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [clang] Support member function poiners in Decl::getFunctionType() (PR #125077)

2025-02-05 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue milestoned https://github.com/llvm/llvm-project/pull/125077 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-02-07 Thread Benjamin Maxwell via cfe-commits
MacDue wrote: Given it looks like #123787 won't be accepted (due to compile time regressions), I think we should restrict this lowering to AArch64 (and other supported targets) until there's a solution for targets without AA in codegen too. Does that seem reasonable? https://github.com/llvm

[clang] [clang] Lower modf builtin using `llvm.modf` intrinsic (PR #126750)

2025-02-11 Thread Benjamin Maxwell via cfe-commits
MacDue wrote: > > when -fno-math-errno is set > > What does -fno-math-errno have to do with anything? modf never sets errno > anyway. With the current `modf` builtin (not changed here) it skips the code path for emitting intrinsics when `math-errno` is enabled. I think setting `ConstIgnoring

[clang] [clang] Lower modf builtin using `llvm.modf` intrinsic (PR #126750)

2025-02-11 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue updated https://github.com/llvm/llvm-project/pull/126750 >From eee5bc815c4b6b7e5a18503959b2a2354d73058b Mon Sep 17 00:00:00 2001 From: Benjamin Maxwell Date: Tue, 11 Feb 2025 15:32:23 + Subject: [PATCH 1/2] [clang] Lower modf builtin using `llvm.modf` intrinsic Th

[clang] [clang] Lower modf builtin using `llvm.modf` intrinsic (PR #126750)

2025-02-11 Thread Benjamin Maxwell via cfe-commits
@@ -859,6 +859,24 @@ static void emitSincosBuiltin(CodeGenFunction &CGF, const CallExpr *E, StoreCos->setMetadata(LLVMContext::MD_noalias, AliasScopeList); } +static llvm::Value *emitModfBuiltin(CodeGenFunction &CGF, const CallExpr *E, +l

[clang] [Docs] Fix typo in TypeSanitizer.rst "tale" -> "table" (NFC) (PR #126721)

2025-02-11 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue edited https://github.com/llvm/llvm-project/pull/126721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Lower modf builtin using `llvm.modf` intrinsic (PR #126750)

2025-02-11 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue created https://github.com/llvm/llvm-project/pull/126750 This updates the existing `modf[f|l]` builtin to be lowered via the `llvm.modf.*` intrinsic when `-fno-math-errno` is set (rather than directly to a library call). >From eee5bc815c4b6b7e5a18503959b2a2354d73058b

[clang] [Docs] Fix typo in TypeSanitizer.rst "tale" -> "table" (NFC) (PR #126721)

2025-02-11 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue edited https://github.com/llvm/llvm-project/pull/126721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] Fix typo "tranpose" (PR #124929)

2025-01-29 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue approved this pull request. https://github.com/llvm/llvm-project/pull/124929 ___ 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-29 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue updated https://github.com/llvm/llvm-project/pull/124750 >From cb83182da6b017397111be606c88a4eeecb4ce9d Mon Sep 17 00:00:00 2001 From: Benjamin Maxwell Date: Tue, 28 Jan 2025 13:34:54 + Subject: [PATCH 1/3] [clang][SME] Account for C++ lambdas in SME builtin diagn

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

2025-01-29 Thread Benjamin Maxwell via cfe-commits
MacDue wrote: > Please add some tests for lambdas with streaming attributes, for example: > > ``` > void f() { auto x = []__arm_locally_streaming {}; x(); } > ``` Done :+1: https://github.com/llvm/llvm-project/pull/124750 ___ cfe-commits mailing lis

[clang] [clang] Support member function poiners in Decl::getFunctionType() (PR #125077)

2025-02-03 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue closed https://github.com/llvm/llvm-project/pull/125077 ___ 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 Benjamin Maxwell via cfe-commits
MacDue wrote: /cherry-pick https://github.com/llvm/llvm-project/commit/7939ce6295e7fc0214cd307f97dfccc0cabde381 https://github.com/llvm/llvm-project/pull/124968 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [clang] Support member function poiners in Decl::getFunctionType() (PR #125077)

2025-01-30 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue edited https://github.com/llvm/llvm-project/pull/125077 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Support member function poiners in Decl::getFunctionType() (PR #125077)

2025-01-30 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue created https://github.com/llvm/llvm-project/pull/125077 This seems consistent with the documentation which claims it: ``` /// Looks through the Decl's underlying type to extract a FunctionType /// when possible. Will return null if the type underlying the Decl does no

[clang] [clang] Support member function poiners in Decl::getFunctionType() (PR #125077)

2025-01-30 Thread Benjamin Maxwell via cfe-commits
MacDue wrote: Created an issue for the `alloc_align` attribute: https://github.com/llvm/llvm-project/issues/125078 https://github.com/llvm/llvm-project/pull/125077 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang] Simplify MS mangling of bultin types (NFC) (PR #125051)

2025-01-30 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue approved this pull request. LGTM (assuming pre-commit goes green) https://github.com/llvm/llvm-project/pull/125051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

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

2025-01-30 Thread Benjamin Maxwell via cfe-commits
@@ -2808,6 +2812,7 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T, Qualifiers, #define SVE_TYPE(Name, Id, SingletonId) \ case BuiltinType::Id: +#define SVE_SCALAR_TYPE(Name, MangledName, Id, SingletonId, Bits) MacDue wrote: You could defi

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

2025-01-30 Thread Benjamin Maxwell via cfe-commits
MacDue wrote: /cherry-pick https://github.com/llvm/llvm-project/commit/2b7509e9885c9a5656bb3c201421e146a21fb88e https://github.com/llvm/llvm-project/pull/124750 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

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

2025-01-30 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue milestoned 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] [clang][SME] Account for C++ lambdas in SME builtin diagnostics (PR #124750)

2025-01-30 Thread Benjamin Maxwell via cfe-commits
MacDue wrote: /cherry-pick https://github.com/llvm/llvm-project/commit/2b7509e9885c9a5656bb3c201421e146a21fb88e https://github.com/llvm/llvm-project/pull/124750 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

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

2025-01-30 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue milestoned 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] [clang] Add sincos builtin using `llvm.sincos` intrinsic (PR #114086)

2024-12-16 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue updated https://github.com/llvm/llvm-project/pull/114086 >From 5e6e49cf8bceed6d137ea67abe81a8a425d5aed8 Mon Sep 17 00:00:00 2001 From: Benjamin Maxwell Date: Mon, 9 Sep 2024 10:15:20 + Subject: [PATCH 1/4] [clang] Add sincos builtin using `llvm.sincos` intrinsic T

[clang] [clang] Add sincos builtin using `llvm.sincos` intrinsic (PR #114086)

2024-12-16 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue updated https://github.com/llvm/llvm-project/pull/114086 >From 5e6e49cf8bceed6d137ea67abe81a8a425d5aed8 Mon Sep 17 00:00:00 2001 From: Benjamin Maxwell Date: Mon, 9 Sep 2024 10:15:20 + Subject: [PATCH 1/3] [clang] Add sincos builtin using `llvm.sincos` intrinsic T

[clang] [clang] Add sincos builtin using `llvm.sincos` intrinsic (PR #114086)

2024-12-17 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue updated https://github.com/llvm/llvm-project/pull/114086 >From 5e6e49cf8bceed6d137ea67abe81a8a425d5aed8 Mon Sep 17 00:00:00 2001 From: Benjamin Maxwell Date: Mon, 9 Sep 2024 10:15:20 + Subject: [PATCH 1/5] [clang] Add sincos builtin using `llvm.sincos` intrinsic T

[clang] [clang] Add sincos builtin using `llvm.sincos` intrinsic (PR #114086)

2024-12-17 Thread Benjamin Maxwell via cfe-commits
@@ -3232,6 +3264,22 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, return RValue::get(emitUnaryMaybeConstrainedFPBuiltin( *this, E, Intrinsic::sinh, Intrinsic::experimental_constrained_sinh)); +case Builtin::BIsincos:

[clang] [clang] Add sincos builtin using `llvm.sincos` intrinsic (PR #114086)

2024-12-17 Thread Benjamin Maxwell via cfe-commits
@@ -3232,6 +3264,22 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, return RValue::get(emitUnaryMaybeConstrainedFPBuiltin( *this, E, Intrinsic::sinh, Intrinsic::experimental_constrained_sinh)); +case Builtin::BIsincos:

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

2024-12-18 Thread Benjamin Maxwell 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 Benjamin Maxwell via cfe-commits
https://github.com/MacDue 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] [clang] Add sincos builtin using `llvm.sincos` intrinsic (PR #114086)

2024-12-19 Thread Benjamin Maxwell via cfe-commits
@@ -3232,6 +3264,22 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, return RValue::get(emitUnaryMaybeConstrainedFPBuiltin( *this, E, Intrinsic::sinh, Intrinsic::experimental_constrained_sinh)); +case Builtin::BIsincos:

[clang] [clang] Add sincos builtin using `llvm.sincos` intrinsic (PR #114086)

2024-12-19 Thread Benjamin Maxwell via cfe-commits
@@ -3232,6 +3264,22 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, return RValue::get(emitUnaryMaybeConstrainedFPBuiltin( *this, E, Intrinsic::sinh, Intrinsic::experimental_constrained_sinh)); +case Builtin::BIsincos:

[clang] [clang] Add sincos builtin using `llvm.sincos` intrinsic (PR #114086)

2024-12-19 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue edited https://github.com/llvm/llvm-project/pull/114086 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-11-21 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue updated https://github.com/llvm/llvm-project/pull/116391 >From 90daf9c544bcb776c8a68ad504ba5eda50eafe8a Mon Sep 17 00:00:00 2001 From: Benjamin Maxwell Date: Fri, 15 Nov 2024 14:35:41 + Subject: [PATCH 1/3] [clang][SME] Ignore flatten for callees mismatched stream

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

2024-11-21 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue updated https://github.com/llvm/llvm-project/pull/116391 >From 90daf9c544bcb776c8a68ad504ba5eda50eafe8a Mon Sep 17 00:00:00 2001 From: Benjamin Maxwell Date: Fri, 15 Nov 2024 14:35:41 + Subject: [PATCH 1/2] [clang][SME] Ignore flatten for callees mismatched stream

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

2024-11-21 Thread Benjamin Maxwell via cfe-commits
MacDue wrote: > I guess this is fine, then. But please add a note describing the current > situation, so the next person looking at this has context. (Put it in > TargetInfo.h, maybe?) > > LGTM with the note. Thanks :+1: Added a note to `TargetInfo.h` https://github.com/llvm/llvm-project/p

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

2024-11-21 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue updated https://github.com/llvm/llvm-project/pull/116391 >From 90daf9c544bcb776c8a68ad504ba5eda50eafe8a Mon Sep 17 00:00:00 2001 From: Benjamin Maxwell Date: Fri, 15 Nov 2024 14:35:41 + Subject: [PATCH 1/4] [clang][SME] Ignore flatten for callees mismatched stream

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

2024-11-21 Thread Benjamin Maxwell 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 Benjamin Maxwell via cfe-commits
@@ -0,0 +1,72 @@ +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -emit-llvm -target-feature +sme %s -o - | FileCheck %s MacDue wrote: Done :+1: https://github.com/llvm/llvm-project/pull/116391 ___ cfe-commits mail

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

2024-11-21 Thread Benjamin Maxwell 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 for callees with mismatched streaming attributes (PR #116391)

2024-11-21 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue 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 Benjamin Maxwell via cfe-commits
https://github.com/MacDue 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 Benjamin Maxwell via cfe-commits
MacDue wrote: Note: I've extended this PR to cover the clang-only `[[clang::always_inline]]` statement attribute (which is currently broken for streaming functions too). It's documentation is more relaxed than the GNU `__attribute__((always_inline))` attribute (which says failing to inline is

[clang] [clang][AArch64] Fix C++11 style initialization of typedef'd vectors (PR #118956)

2024-12-06 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue closed https://github.com/llvm/llvm-project/pull/118956 ___ 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-10 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue edited 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] [AArch64][Clang] Add support for __arm_agnostic("sme_za_state") (PR #121788)

2025-01-10 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue approved this pull request. LGTM, thanks for addressing my comments, just a minor nit-pick: https://github.com/llvm/llvm-project/pull/121788 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

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

2025-01-10 Thread Benjamin Maxwell via cfe-commits
@@ -3835,6 +3835,9 @@ def err_sme_unimplemented_za_save_restore : Error< "call to a function that shares state other than 'za' from a " "function that has live 'za' state requires a spill/fill of ZA, which is not yet " "implemented">; +def err_sme_unimplemented_agnostic_

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

2025-01-21 Thread Benjamin Maxwell via cfe-commits
MacDue wrote: > > > > @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. > > > > > > > > > I don't remember any reason for alias analysis

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

2025-01-20 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue commented: Nit on the title. Could the title be something like: `[Arch64][SVE] Lower svrev_* to llvm.vector.reverse`? Since nothing in this PR is doing the folding (I think the description saying this enables the fold is good). https://github.com/llvm/llvm-project/pul

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

2025-01-27 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue updated https://github.com/llvm/llvm-project/pull/124590 >From f3083be395aa9cfb1e6d44f00a32faaee347468a Mon Sep 17 00:00:00 2001 From: Benjamin Maxwell Date: Mon, 27 Jan 2025 16:43:58 + Subject: [PATCH 1/2] [clang][SME] Emit error for OpemMP captured regions in SM

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

2025-01-27 Thread Benjamin Maxwell via cfe-commits
@@ -4568,9 +4568,28 @@ buildCapturedStmtCaptureList(Sema &S, CapturedRegionScopeInfo *RSI, return false; } +static std::optional +isOpenMPCapturedRegionInArmSMEFunction(Sema const &S, CapturedRegionKind Kind) { + if (!S.getLangOpts().OpenMP || Kind != CR_OpenMP) +retu

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

2025-01-27 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue updated https://github.com/llvm/llvm-project/pull/124590 >From 232e34b50d8e85665e331ec420ceacee716b19e6 Mon Sep 17 00:00:00 2001 From: Benjamin Maxwell Date: Mon, 27 Jan 2025 16:43:58 + Subject: [PATCH] [clang][SME] Emit error for OpemMP captured regions in SME fu

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

2025-01-27 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue updated https://github.com/llvm/llvm-project/pull/124590 >From f3083be395aa9cfb1e6d44f00a32faaee347468a Mon Sep 17 00:00:00 2001 From: Benjamin Maxwell Date: Mon, 27 Jan 2025 16:43:58 + Subject: [PATCH] [clang][SME] Emit error for OpemMP captured regions in SME fu

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

2025-01-27 Thread Benjamin Maxwell 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] [clang][SME] Emit error for OpemMP captured regions in SME functions (PR #124590)

2025-01-27 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue edited 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] Emit error for OpemMP captured regions in SME functions (PR #124590)

2025-01-27 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue edited 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] Emit error for OpenMP captured regions in SME functions (PR #124590)

2025-01-27 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue edited 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] Emit error for OpemMP captured regions in streaming functions (PR #124590)

2025-01-27 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue created https://github.com/llvm/llvm-project/pull/124590 Currently, these generate incorrect code, as streaming attributes are not propagated to the outlined function. As we've yet to work on mixing OpenMP and streaming functions (and determine how they should interac

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

2025-01-28 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue closed 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] Emit error for OpenMP captured regions in SME functions (PR #124590)

2025-01-28 Thread Benjamin Maxwell via cfe-commits
@@ -0,0 +1,68 @@ +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sme2 -fopenmp -fsyntax-only -verify %s +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sme2 -fopenmp -fsyntax-only -verify=expected-

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

2025-01-28 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue updated https://github.com/llvm/llvm-project/pull/124590 >From f3083be395aa9cfb1e6d44f00a32faaee347468a Mon Sep 17 00:00:00 2001 From: Benjamin Maxwell Date: Mon, 27 Jan 2025 16:43:58 + Subject: [PATCH 1/3] [clang][SME] Emit error for OpemMP captured regions in SM

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

2025-01-28 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue created https://github.com/llvm/llvm-project/pull/124750 A C++ lambda does not inherit attributes from the parent function. So the SME builtin diagnostics should look at the lambda's attributes, not the parent function's. The fix is very simple and just adds the miss

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

2025-01-28 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue updated https://github.com/llvm/llvm-project/pull/124750 >From cb83182da6b017397111be606c88a4eeecb4ce9d Mon Sep 17 00:00:00 2001 From: Benjamin Maxwell Date: Tue, 28 Jan 2025 13:34:54 + Subject: [PATCH 1/2] [clang][SME] Account for C++ lambdas in SME builtin diagn

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

2025-01-30 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue closed 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 Benjamin Maxwell via cfe-commits
https://github.com/MacDue edited 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] Add MSVC mangling for the __mfp8 type (PR #124968)

2025-01-30 Thread Benjamin Maxwell via cfe-commits
@@ -2808,6 +2812,7 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T, Qualifiers, #define SVE_TYPE(Name, Id, SingletonId) \ case BuiltinType::Id: +#define SVE_SCALAR_TYPE(Name, MangledName, Id, SingletonId, Bits) MacDue wrote: Is there a rea

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

2025-01-30 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue edited 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] Add MSVC mangling for the __mfp8 type (PR #124968)

2025-01-30 Thread Benjamin Maxwell via cfe-commits
@@ -2808,6 +2812,7 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T, Qualifiers, #define SVE_TYPE(Name, Id, SingletonId) \ case BuiltinType::Id: +#define SVE_SCALAR_TYPE(Name, MangledName, Id, SingletonId, Bits) MacDue wrote: With the curre

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

2025-02-13 Thread Benjamin Maxwell via cfe-commits
@@ -21962,6 +21962,35 @@ SDValue tryLowerPartialReductionToWideAdd(SDNode *N, return DAG.getNode(TopOpcode, DL, AccVT, BottomNode, ExtOp); } +static SDValue foldRevInvolution(SDNode *N) { MacDue wrote: Please add a doc comment that explains what this does

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

2025-02-13 Thread Benjamin Maxwell 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 Benjamin Maxwell 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 Benjamin Maxwell 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 Benjamin Maxwell via cfe-commits
https://github.com/MacDue edited https://github.com/llvm/llvm-project/pull/116422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CLANG]Update svget, svset, svcrete, svundef to have FP8 variants (PR #126754)

2025-02-11 Thread Benjamin Maxwell via cfe-commits
MacDue wrote: Typo `svcrete` -> `svcreate` (PR title/description) https://github.com/llvm/llvm-project/pull/126754 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][clang] Split clang/lib/CodeGen/CGBuiltin.cpp into target-specific files (PR #132252)

2025-03-20 Thread Benjamin Maxwell via cfe-commits
@@ -0,0 +1,8530 @@ +//===-- AArch64.cpp - Emit LLVM Code for builtins -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang-tools-extra] [clang-doc][NFC] fix description typo (PR #132310)

2025-04-05 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue approved this pull request. https://github.com/llvm/llvm-project/pull/132310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][clang] Split clang/lib/CodeGen/CGBuiltin.cpp into target-specific files (PR #132252)

2025-04-05 Thread Benjamin Maxwell via cfe-commits
@@ -0,0 +1,8530 @@ +//===-- AArch64.cpp - Emit LLVM Code for builtins -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [Clang][Driver] Fix target parsing for -fveclib=libmvec option. (PR #138288)

2025-05-02 Thread Benjamin Maxwell via cfe-commits
@@ -934,7 +934,7 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args, std::optional OptVal = llvm::StringSwitch>(ArgVecLib->getValue()) .Case("Accelerate", "Accelerate") -.Case("LIBMVEC", "LIBMVEC-X86") +

[clang] [llvm] [LLVM][VecLib] Refactor LIBMVEC integration to be target neutral. (PR #138262)

2025-05-06 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue approved this pull request. LGTM, thanks :+1: https://github.com/llvm/llvm-project/pull/138262 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][VecLib] Refactor LIBMVEC integration to be target neutral. (PR #138262)

2025-05-06 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue edited https://github.com/llvm/llvm-project/pull/138262 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][VecLib] Refactor LIBMVEC integration to be target neutral. (PR #138262)

2025-05-06 Thread Benjamin Maxwell via cfe-commits
@@ -1360,8 +1360,15 @@ void TargetLibraryInfoImpl::addVectorizableFunctionsFromVecLib( addVectorizableFunctions(VecFuncs_DarwinLibSystemM); break; } - case LIBMVEC_X86: { -addVectorizableFunctions(VecFuncs_LIBMVEC_X86); + case LIBMVEC: { +switch (TargetTrip

[clang] [Clang][Driver] Fix target parsing for -fveclib=libmvec option. (PR #138288)

2025-05-02 Thread Benjamin Maxwell via cfe-commits
@@ -934,7 +934,7 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args, std::optional OptVal = llvm::StringSwitch>(ArgVecLib->getValue()) .Case("Accelerate", "Accelerate") -.Case("LIBMVEC", "LIBMVEC-X86") +

[clang] [Clang][Driver] Fix target parsing for -fveclib=libmvec option. (PR #138288)

2025-05-02 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue approved this pull request. LGTM, thanks :+1: There's one other use of "LIBMVEC" in flang that looks suspicious, but I've not check if it's actually an issue: https://github.com/llvm/llvm-project/blob/d6dbe7799e638702309e23fc7b73d4be2231e2ac/flang/lib/Frontend/Compil

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

2025-02-19 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue closed https://github.com/llvm/llvm-project/pull/121763 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-02-18 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue updated https://github.com/llvm/llvm-project/pull/121763 >From 42b096396f36adc6f1ad34de263a80dd7e4e0960 Mon Sep 17 00:00:00 2001 From: Benjamin Maxwell Date: Mon, 6 Jan 2025 11:49:48 + Subject: [PATCH 1/5] [clang] Lower non-builtin sincos[f|l] calls to llvm.sincos

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

2025-02-18 Thread Benjamin Maxwell via cfe-commits
MacDue wrote: > I'm a hard no on making this a target dependent option. Just enable it > unconditionally and take the regression Fine, I don't mind the regression as it does not affect targets I work on, I just wanted to make the changes needed for AArch64 without knowingly slightly regressin

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

2025-02-18 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue edited https://github.com/llvm/llvm-project/pull/121763 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-02-18 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue updated https://github.com/llvm/llvm-project/pull/121763 >From 42b096396f36adc6f1ad34de263a80dd7e4e0960 Mon Sep 17 00:00:00 2001 From: Benjamin Maxwell Date: Mon, 6 Jan 2025 11:49:48 + Subject: [PATCH 1/3] [clang] Lower non-builtin sincos[f|l] calls to llvm.sincos

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

2025-02-18 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue edited https://github.com/llvm/llvm-project/pull/121763 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-02-18 Thread Benjamin Maxwell via cfe-commits
MacDue wrote: I've pushed a change to restrict this to AArch64 (other targets could enable it too) given no reply above, or progress on https://github.com/llvm/llvm-project/pull/123787. https://github.com/llvm/llvm-project/pull/121763 ___ cfe-commits

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

2025-02-18 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue updated https://github.com/llvm/llvm-project/pull/121763 >From 42b096396f36adc6f1ad34de263a80dd7e4e0960 Mon Sep 17 00:00:00 2001 From: Benjamin Maxwell Date: Mon, 6 Jan 2025 11:49:48 + Subject: [PATCH 1/4] [clang] Lower non-builtin sincos[f|l] calls to llvm.sincos

[clang] [clang] Lower modf builtin using `llvm.modf` intrinsic (PR #126750)

2025-02-19 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue closed https://github.com/llvm/llvm-project/pull/126750 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix typo 'dereferencable' to 'dereferenceable' (PR #116761)

2025-03-08 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue closed https://github.com/llvm/llvm-project/pull/116761 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix typo 'dereferencable' to 'dereferenceable' (PR #116761)

2025-03-08 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue approved this pull request. https://github.com/llvm/llvm-project/pull/116761 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Fix typo with colon-separated syntax for system registers (PR #105608)

2025-03-10 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue approved this pull request. LGTM too, and lines up with the ACLE update + sysreg spec. https://github.com/llvm/llvm-project/pull/105608 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] Reland "[clang] Lower modf builtin using `llvm.modf` intrinsic" (PR #130761)

2025-03-11 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue created https://github.com/llvm/llvm-project/pull/130761 Reverts https://github.com/llvm/llvm-project/commit/c40f0fe4348bb9304b95bd317665bf1cb2bdcc85 Original description: This updates the existing modf[f|l] builtin to be lowered via the llvm.modf.* intrinsic (rather

<    1   2   3   >