[clang] [Clang][SVE2.1] Make a part of the name optional for `svwhileXX` builtins with predicate-as-counter (PR #75200)

2023-12-14 Thread Momchil Velikov via cfe-commits
@@ -1,12 +1,20 @@ // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s // RUN: %clang_cc1 -triple aarch64-none-linux-gnu

[clang] [Clang][SVE2.1] Make a part of the name optional for `svwhileXX` builtins with predicate-as-counter (PR #75200)

2023-12-14 Thread Momchil Velikov via cfe-commits
@@ -1,12 +1,20 @@ // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s // RUN: %clang_cc1 -triple aarch64-none-linux-gnu

[clang] [Clang][SVE2.1] Add intrinsics for `WHILEcc` resulting in predicate pair (PR #75107)

2023-12-13 Thread Momchil Velikov via cfe-commits
@@ -1341,6 +1341,26 @@ def SVWHILEHS_U32 : SInst<"svwhilege_{d}[_{1}]", "Pmm", "PUcPUsPUiPUl", MergeNon def SVWHILEHS_U64 : SInst<"svwhilege_{d}[_{1}]", "Pnn", "PUcPUsPUiPUl", MergeNone, "aarch64_sve_whilehs", [IsOverloadWhile]>; } +let TargetGuard = "sve2p1|sme2" in { +

[clang] [Clang][SVE2.1] Make a part of the name optional for `svwhileXX` builtins with predicate-as-counter (PR #75200)

2023-12-13 Thread Momchil Velikov via cfe-commits
@@ -1950,19 +1950,17 @@ let TargetGuard = "sve2p1|sme2" in { //FIXME: Replace IsStreamingCompatible with IsStreamingOrHasSVE2p1 when available def SVPEXT_SINGLE : SInst<"svpext_lane_{d}", "P}i", "QcQsQiQl", MergeNone, "aarch64_sve_pext", [IsStreamingCompatible], [ImmCheck<1,

[clang] [Clang][SVE2.1] Make a part of the name optional for `svwhileXX` builtins with predicate-as-counter (PR #75200)

2023-12-13 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/75200 >From bb881371fb036819a1d6489a9779e2c5ac7e7d3c Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Tue, 12 Dec 2023 15:08:33 + Subject: [PATCH 1/3] [Clang][SVE2.1] Make the part of the name optional

[clang] [Clang][SVE2.1] Make a part of the name optional for `svwhileXX` builtins with predicate-as-counter (PR #75200)

2023-12-13 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/75200 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][SVE2.1] Make a part of the name optional for `svwhileXX` builtins with predicate-as-counter (PR #75200)

2023-12-13 Thread Momchil Velikov via cfe-commits
@@ -1950,19 +1950,17 @@ let TargetGuard = "sve2p1|sme2" in { //FIXME: Replace IsStreamingCompatible with IsStreamingOrHasSVE2p1 when available def SVPEXT_SINGLE : SInst<"svpext_lane_{d}", "P}i", "QcQsQiQl", MergeNone, "aarch64_sve_pext", [IsStreamingCompatible], [ImmCheck<1,

[clang] [Clang][SVE2.1] Make a part of the name optional for `svwhileXX` builtins with predicate-as-counter (PR #75200)

2023-12-13 Thread Momchil Velikov via cfe-commits
@@ -1950,19 +1950,17 @@ let TargetGuard = "sve2p1|sme2" in { //FIXME: Replace IsStreamingCompatible with IsStreamingOrHasSVE2p1 when available def SVPEXT_SINGLE : SInst<"svpext_lane_{d}", "P}i", "QcQsQiQl", MergeNone, "aarch64_sve_pext", [IsStreamingCompatible], [ImmCheck<1,

[clang] [Clang][SVE2.1] Make a part of the name optional for `svwhileXX` builtins with predicate-as-counter (PR #75200)

2023-12-13 Thread Momchil Velikov via cfe-commits
@@ -1950,19 +1950,17 @@ let TargetGuard = "sve2p1|sme2" in { //FIXME: Replace IsStreamingCompatible with IsStreamingOrHasSVE2p1 when available def SVPEXT_SINGLE : SInst<"svpext_lane_{d}", "P}i", "QcQsQiQl", MergeNone, "aarch64_sve_pext", [IsStreamingCompatible], [ImmCheck<1,

[clang] [Clang][SVE2.1] Make a part of the name optional for `svwhileXX` builtins with predicate-as-counter (PR #75200)

2023-12-13 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/75200 >From bb881371fb036819a1d6489a9779e2c5ac7e7d3c Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Tue, 12 Dec 2023 15:08:33 + Subject: [PATCH 1/2] [Clang][SVE2.1] Make the part of the name optional

[clang] [Clang][SVE2.1] Make a part of the name optional for `svwhileXX` builtins with predicate-as-counter (PR #75200)

2023-12-12 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/75200 >From bb881371fb036819a1d6489a9779e2c5ac7e7d3c Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Tue, 12 Dec 2023 15:08:33 + Subject: [PATCH] [Clang][SVE2.1] Make the part of the name optional for

[clang] [Clang][SVE2.1] Make a part of the name optional for `svwhileXX` builtins with predicate-as-counter (PR #75200)

2023-12-12 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov created https://github.com/llvm/llvm-project/pull/75200 The `_s64`/`_u64` part can be omitted now. It's inferred from the argument types. >From 1cab2e8cfb0427e5d97e0f306460d1d83123d78b Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Tue, 12 Dec 2023

[clang] [Clang][SVE2.1] Add intrinsics for `WHILEcc` resulting in predicate pair (PR #75107)

2023-12-12 Thread Momchil Velikov via cfe-commits
@@ -1341,6 +1341,26 @@ def SVWHILEHS_U32 : SInst<"svwhilege_{d}[_{1}]", "Pmm", "PUcPUsPUiPUl", MergeNon def SVWHILEHS_U64 : SInst<"svwhilege_{d}[_{1}]", "Pnn", "PUcPUsPUiPUl", MergeNone, "aarch64_sve_whilehs", [IsOverloadWhile]>; } +let TargetGuard = "sve2p1|sme2" in {

[llvm] [clang] [Clang][SVE2.1] Add floating-point variants of `svrevd_XX` (PR #75117)

2023-12-11 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov created https://github.com/llvm/llvm-project/pull/75117 None >From 4fe606a2cf764ae4281789727d241c91c3cb9c39 Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Mon, 11 Dec 2023 23:25:07 + Subject: [PATCH] [Clang][SVE2.1] Add floating-point variants of

[llvm] [clang] [Clang] Emit TBAA info for enums in C (PR #73326)

2023-12-07 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: I thought the suggestion was to add a few lines to https://github.com/llvm/llvm-project/blob/main/clang/docs/ReleaseNotes.rst https://github.com/llvm/llvm-project/pull/73326 ___ cfe-commits mailing list

[clang] [llvm] [Verifier] Check function attributes related to branch protection (NFC) (PR #70565)

2023-12-04 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/70565 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [Verifier] Check function attributes related to branch protection (NFC) (PR #70565)

2023-12-04 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/70565 >From 66a84fffb5d1b5c34eea9ecdb83a88afb0b627ff Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Sat, 28 Oct 2023 15:01:36 +0100 Subject: [PATCH 1/4] [Verifier] Check function attributes related to

[clang] [clang][AArch64] Pass down stack clash protection options to LLVM/Backend (PR #68993)

2023-11-30 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/68993 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Verifier] Check function attributes related to branch protection (NFC) (PR #70565)

2023-11-30 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: Ping? https://github.com/llvm/llvm-project/pull/70565 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [AArch64] Stack probing for dynamic allocas in SelectionDAG (PR #66525)

2023-11-30 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: > Do the call frame changes here affect Windows? (I guess that would indicate a > latent bug in our Windows ABI support...) TBH, I have not tested on Windows. However, by construction, I've hopefully made sure the Windows and non-Windows are isolated and separate -

[clang] [Clang] Emit TBAA info for enums in C (PR #73326)

2023-11-24 Thread Momchil Velikov via cfe-commits
@@ -196,11 +196,14 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) { // Enum types are distinct types. In C++ they have "underlying types", // however they aren't related for TBAA. if (const EnumType *ETy = dyn_cast(Ty)) { +if (!Features.CPlusPlus) +

[clang] [clang][AArch64] Pass down stack clash protection options to LLVM/Backend (PR #68993)

2023-11-23 Thread Momchil Velikov via cfe-commits
@@ -1076,6 +1076,16 @@ void CodeGenModule::Release() { "sign-return-address-with-bkey", 1); } + if (Arch == llvm::Triple::aarch64 || Arch == llvm::Triple::aarch64_be) { momchil-velikov wrote: Done, we now emit both

[llvm] [clang] [AArch64] Stack probing for dynamic allocas in SelectionDAG (PR #66525)

2023-11-23 Thread Momchil Velikov via cfe-commits
@@ -0,0 +1,363 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple aarch64-none-eabi < %s -verify-machineinstrs | FileCheck %s + +; Dynamically-sized allocation, needs a loop which can handle any size at +; runtime. The final

[llvm] [clang] [AArch64] Stack probing for dynamic allocas in SelectionDAG (PR #66525)

2023-11-23 Thread Momchil Velikov via cfe-commits
@@ -861,6 +861,12 @@ def AArch64stilp : SDNode<"AArch64ISD::STILP", SDT_AArch64stilp, [SDNPHasChain, def AArch64stnp : SDNode<"AArch64ISD::STNP", SDT_AArch64stnp, [SDNPHasChain, SDNPMayStore, SDNPMemOperand]>; def AArch64tbl : SDNode<"AArch64ISD::TBL", SDT_AArch64TBL>; +

[clang] [llvm] [AArch64] Stack probing for dynamic allocas in SelectionDAG (PR #66525)

2023-11-23 Thread Momchil Velikov via cfe-commits
@@ -9461,6 +9462,94 @@ bool AArch64InstrInfo::isReallyTriviallyReMaterializable( return TargetInstrInfo::isReallyTriviallyReMaterializable(MI); } +MachineBasicBlock::iterator +AArch64InstrInfo::probedStackAlloc(MachineBasicBlock::iterator MBBI,

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-23 Thread Momchil Velikov via cfe-commits
@@ -0,0 +1,722 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple aarch64-none-eabi < %s -verify-machineinstrs | FileCheck %s +; RUN: llc -mtriple aarch64-none-eabi < %s -verify-machineinstrs -global-isel -global-isel-abort=2 |

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-23 Thread Momchil Velikov via cfe-commits
@@ -1757,46 +1826,55 @@ void AArch64FrameLowering::emitPrologue(MachineFunction , } } - StackOffset AllocateBefore = SVEStackSize, AllocateAfter = {}; + StackOffset SVECalleeSavedSize = {}, SVELocalsSize = SVEStackSize; MachineBasicBlock::iterator CalleeSavesBegin

[clang] [clang][AArch64] Pass down stack clash protection options to LLVM/Backend (PR #68993)

2023-11-23 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/68993 >From 553f647e3f8460e376b8a09233b23a0bd6b12ead Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Wed, 11 Oct 2023 17:22:51 +0100 Subject: [PATCH 1/2] [clang][AArch64] Pass down stack clash protection

[clang] [llvm] [AArch64] Add quadword gather load/scatter store intrinsics with unscaled vector offset (PR #71290)

2023-11-22 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/71290 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: I only now noticed I had a bunch of comments sitting for a few weeks in "Pending" state :/ https://github.com/llvm/llvm-project/pull/66524 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Momchil Velikov via cfe-commits
@@ -1757,46 +1826,55 @@ void AArch64FrameLowering::emitPrologue(MachineFunction , } } - StackOffset AllocateBefore = SVEStackSize, AllocateAfter = {}; + StackOffset SVECalleeSavedSize = {}, SVELocalsSize = SVEStackSize; MachineBasicBlock::iterator CalleeSavesBegin

[llvm] [clang] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Momchil Velikov via cfe-commits
@@ -1076,6 +1076,16 @@ void CodeGenModule::Release() { "sign-return-address-with-bkey", 1); } + if (Arch == llvm::Triple::aarch64 || Arch == llvm::Triple::aarch64_be) { +auto *InlineAsm = llvm::MDString::get(TheModule.getContext(),

[llvm] [clang] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Momchil Velikov via cfe-commits
@@ -9460,6 +9461,94 @@ bool AArch64InstrInfo::isReallyTriviallyReMaterializable( return TargetInstrInfo::isReallyTriviallyReMaterializable(MI); } +MachineBasicBlock::iterator +AArch64InstrInfo::insertStackProbingLoop(MachineBasicBlock::iterator MBBI, +

[llvm] [clang] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Momchil Velikov via cfe-commits
@@ -26262,3 +26262,37 @@ bool AArch64TargetLowering::preferScalarizeSplat(SDNode *N) const { } return true; } + +bool AArch64TargetLowering::hasInlineStackProbe( +const MachineFunction ) const { + // If the function specifically requests inline stack probes, emit

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Momchil Velikov via cfe-commits
@@ -1827,12 +1908,36 @@ void AArch64FrameLowering::emitPrologue(MachineFunction , // FIXME: in the case of dynamic re-alignment, NumBytes doesn't have // the correct value here, as NumBytes also includes padding bytes, // which shouldn't be counted here. -

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Momchil Velikov via cfe-commits
@@ -672,6 +673,74 @@ void AArch64FrameLowering::emitCalleeSavedSVERestores( emitCalleeSavedRestores(MBB, MBBI, true); } +void AArch64FrameLowering::allocateSVEStackSpace( +MachineBasicBlock , MachineBasicBlock::iterator MBBI, +StackOffset AllocSize, StackOffset

[llvm] [clang] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Momchil Velikov via cfe-commits
@@ -9460,6 +9461,94 @@ bool AArch64InstrInfo::isReallyTriviallyReMaterializable( return TargetInstrInfo::isReallyTriviallyReMaterializable(MI); } +MachineBasicBlock::iterator +AArch64InstrInfo::insertStackProbingLoop(MachineBasicBlock::iterator MBBI, +

[llvm] [clang] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Momchil Velikov via cfe-commits
@@ -672,6 +673,74 @@ void AArch64FrameLowering::emitCalleeSavedSVERestores( emitCalleeSavedRestores(MBB, MBBI, true); } +void AArch64FrameLowering::allocateSVEStackSpace( +MachineBasicBlock , MachineBasicBlock::iterator MBBI, +StackOffset AllocSize, StackOffset

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Momchil Velikov via cfe-commits
@@ -97,14 +97,45 @@ AArch64FunctionInfo::AArch64FunctionInfo(const Function , if (const auto *BTE = mdconst::extract_or_null( F.getParent()->getModuleFlag("branch-target-enforcement"))) BranchTargetEnforcement = BTE->getZExtValue(); -return; + } else

[llvm] [clang] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Momchil Velikov via cfe-commits
@@ -4052,3 +4193,192 @@ void AArch64FrameLowering::orderFrameObjects( dbgs() << "\n"; }); } + +/// Emit a loop to decrement SP until it is equal to TargetReg, with probes at +/// least every ProbeSize bytes. Returns an iterator of the first instruction +/// after the

[llvm] [clang] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Momchil Velikov via cfe-commits
@@ -1827,12 +1908,36 @@ void AArch64FrameLowering::emitPrologue(MachineFunction , // FIXME: in the case of dynamic re-alignment, NumBytes doesn't have // the correct value here, as NumBytes also includes padding bytes, // which shouldn't be counted here. -

[llvm] [clang] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-21 Thread Momchil Velikov via cfe-commits
@@ -26262,3 +26262,37 @@ bool AArch64TargetLowering::preferScalarizeSplat(SDNode *N) const { } return true; } + +bool AArch64TargetLowering::hasInlineStackProbe( +const MachineFunction ) const { + // If the function specifically requests inline stack probes, emit

[llvm] [clang] [AArch64] Add quadword gather load/scatter store intrinsics with unscaled vector offset (PR #71290)

2023-11-21 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/71290 >From 22ecaa7d6f7854bd89da7390a7813bd9f1397f0b Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Sat, 4 Nov 2023 12:02:06 + Subject: [PATCH 1/2] [AArch64] Add quadword gather load/scatter store

[clang] [llvm] [AArch64] Add SVE2.1 intrinsics for indexed quadword gather loads and scatter stores (PR #70476)

2023-11-21 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/70476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [AArch64] Add SVE2.1 intrinsics for indexed quadword gather loads and scatter stores (PR #70476)

2023-11-21 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/70476 >From 9f90ac3383b37e9d2310836527d01a94b6fbadb9 Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Fri, 27 Oct 2023 16:09:07 +0100 Subject: [PATCH 1/2] [AArch64] Add SVE2.1 intrinsics for indexed

[clang] [llvm] [AArch64][SVE2.1] Add intrinsics for quadword loads/stores with unscaled offset (PR #70474)

2023-11-21 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/70474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Add SVE2.1 intrinsics for indexed quadword gather loads and scatter stores (PR #70476)

2023-11-21 Thread Momchil Velikov via cfe-commits
@@ -420,6 +449,35 @@ let TargetGuard = "sve,bf16" in { def SVSTNT1_VNUM_BF : MInst<"svstnt1_vnum[_{d}]", "vPpld", "b", [IsStore], MemEltTyDefault, "aarch64_sve_stnt1">; } +let TargetGuard = "sve2p1" in { + // Contiguous truncating store from quadword (single vector). +

[clang] [llvm] [AArch64][SVE2.1] Add intrinsics for quadword loads/stores with unscaled offset (PR #70474)

2023-11-21 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/70474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [AArch64][SVE2.1] Add intrinsics for quadword loads/stores with unscaled offset (PR #70474)

2023-11-21 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/70474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][SVE2.1] Add intrinsics for quadword loads/stores with unscaled offset (PR #70474)

2023-11-21 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/70474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang-tools-extra] [clang] [SVE2.1][Clang][LLVM]Add BFloat16 builtin in Clang and LLVM intrinisc (PR #70362)

2023-11-21 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov approved this pull request. LGTM, cheers! Check the commit message, a double colon in `Co-authored-by::`. https://github.com/llvm/llvm-project/pull/70362 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [SVE2.1][Clang][LLVM]Add 128bits builtin in Clang and LLVM intrinisc (PR #71930)

2023-11-20 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov approved this pull request. LGTM, cheers! https://github.com/llvm/llvm-project/pull/71930 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SVE2.1][Clang][LLVM]Add 128bits builtin in Clang and LLVM intrinisc (PR #71930)

2023-11-20 Thread Momchil Velikov via cfe-commits
@@ -1992,3 +1992,36 @@ let TargetGuard = "sme2" in { def SVADD_SINGLE_X2 : SInst<"svadd[_single_{d}_x2]", "22d", "cUcsUsiUilUl", MergeNone, "aarch64_sve_add_single_x2", [IsStreaming], []>; def SVADD_SINGLE_X4 : SInst<"svadd[_single_{d}_x4]", "44d", "cUcsUsiUilUl",

[clang] [clang-tools-extra] [llvm] [SVE2.1][Clang][LLVM]Add BFloat16 builtin in Clang and LLVM intrinisc (PR #70362)

2023-11-20 Thread Momchil Velikov via cfe-commits
@@ -0,0 +1,61 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -target-feature +sve -S -disable-O0-optnone

[clang] [clang][AArch64] Pass down stack clash protection options to LLVM/Backend (PR #68993)

2023-11-17 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/68993 >From b42de31d5584cddb90c22c94e9d971feaaf0b624 Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Wed, 11 Oct 2023 17:22:51 +0100 Subject: [PATCH] [clang][AArch64] Pass down stack clash protection

[llvm] [clang] [AArch64][SVE2.1] Add intrinsics for quadword loads/stores with unscaled offset (PR #70474)

2023-11-15 Thread Momchil Velikov via cfe-commits
@@ -0,0 +1,2503 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +bf16 -S -disable-O0-optnone -Werror -Wall

[llvm] [clang] [SVE2.1][Clang][LLVM]Add 128bits builtin in Clang and LLVM intrinisc (PR #71930)

2023-11-15 Thread Momchil Velikov via cfe-commits
@@ -1992,3 +1992,36 @@ let TargetGuard = "sme2" in { def SVADD_SINGLE_X2 : SInst<"svadd[_single_{d}_x2]", "22d", "cUcsUsiUilUl", MergeNone, "aarch64_sve_add_single_x2", [IsStreaming], []>; def SVADD_SINGLE_X4 : SInst<"svadd[_single_{d}_x4]", "44d", "cUcsUsiUilUl",

[llvm] [clang] [SVE2.1][Clang][LLVM]Add 128bits builtin in Clang and LLVM intrinisc (PR #71930)

2023-11-15 Thread Momchil Velikov via cfe-commits
@@ -116,3 +116,9 @@ void test_svdot_lane_2way(svint32_t s32, svuint32_t u32, svint16_t s16, svuint16 svdot_lane_u32_u16_u16(u32, u16, u16, 4); // expected-error {{argument value 4 is outside the valid range [0, 3]}} svdot_lane_f32_f16_f16(f32, f16, f16, 4); //

[llvm] [clang] [SVE2.1][Clang][LLVM]Add 128bits builtin in Clang and LLVM intrinisc (PR #71930)

2023-11-15 Thread Momchil Velikov via cfe-commits
@@ -0,0 +1,217 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1\ +// RUN: -S -Werror -emit-llvm

[clang] [llvm] [SVE2.1][Clang][LLVM]Add 128bits builtin in Clang and LLVM intrinisc (PR #71930)

2023-11-15 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov commented: In addition to the code comments: In the (tentative) commit message the prototype `svuint8_t svextq_lane[_u8](svuint8_t zdn,` is cut short. The prototype of `svint8_t svtbxq[_s8](svint8_t zn, svuint8_t zm);` is missing an parameter. The attribution

[llvm] [clang] [SVE2.1][Clang][LLVM]Add 128bits builtin in Clang and LLVM intrinisc (PR #71930)

2023-11-15 Thread Momchil Velikov via cfe-commits
@@ -0,0 +1,216 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1\ +// RUN: -S -Werror -emit-llvm

[llvm] [clang] [SVE2.1][Clang][LLVM]Add 128bits builtin in Clang and LLVM intrinisc (PR #71930)

2023-11-15 Thread Momchil Velikov via cfe-commits
@@ -0,0 +1,217 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1\ +// RUN: -S -Werror -emit-llvm

[clang] [llvm] [SVE2.1][Clang][LLVM]Add 128bits builtin in Clang and LLVM intrinisc (PR #71930)

2023-11-15 Thread Momchil Velikov via cfe-commits
@@ -1992,3 +1992,36 @@ let TargetGuard = "sme2" in { def SVADD_SINGLE_X2 : SInst<"svadd[_single_{d}_x2]", "22d", "cUcsUsiUilUl", MergeNone, "aarch64_sve_add_single_x2", [IsStreaming], []>; def SVADD_SINGLE_X4 : SInst<"svadd[_single_{d}_x4]", "44d", "cUcsUsiUilUl",

[llvm] [clang] [SVE2.1][Clang][LLVM]Add 128bits builtin in Clang and LLVM intrinisc (PR #71930)

2023-11-15 Thread Momchil Velikov via cfe-commits
@@ -1992,3 +1992,36 @@ let TargetGuard = "sme2" in { def SVADD_SINGLE_X2 : SInst<"svadd[_single_{d}_x2]", "22d", "cUcsUsiUilUl", MergeNone, "aarch64_sve_add_single_x2", [IsStreaming], []>; def SVADD_SINGLE_X4 : SInst<"svadd[_single_{d}_x4]", "44d", "cUcsUsiUilUl",

[llvm] [clang] [SVE2.1][Clang][LLVM]Add 128bits builtin in Clang and LLVM intrinisc (PR #71930)

2023-11-15 Thread Momchil Velikov via cfe-commits
@@ -0,0 +1,217 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1\ +// RUN: -S -Werror -emit-llvm

[clang] [llvm] [SVE2.1][Clang][LLVM]Add 128bits builtin in Clang and LLVM intrinisc (PR #71930)

2023-11-15 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/71930 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-14 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: Latest update adds this patch: https://github.com/llvm/llvm-project/pull/66524/commits/ff16f798d747ec9c16ebeeccbf4ef7ddd77f4636 https://github.com/llvm/llvm-project/pull/66524 ___ cfe-commits mailing list

[clang] [llvm] [clang][AArch64] Pass down stack clash protection options to LLVM/Backend (PR #68993)

2023-11-14 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/68993 >From a0f51e927e03140dae160151229f72383df9aeb6 Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Sat, 11 Nov 2023 11:41:48 + Subject: [PATCH 1/3] [AArch64] Refactor allocation of locals and stack

[clang] [clang-tools-extra] [llvm] [SVE2.1][Clang][LLVM]Add BFloat16 builtin in Clang and LLVM intrinisc (PR #70362)

2023-11-13 Thread Momchil Velikov via cfe-commits
@@ -0,0 +1,61 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -target-feature +sve -S -disable-O0-optnone

[clang] [clang-tools-extra] [llvm] [SVE2.1][Clang][LLVM]Add BFloat16 builtin in Clang and LLVM intrinisc (PR #70362)

2023-11-13 Thread Momchil Velikov via cfe-commits
@@ -0,0 +1,61 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -target-feature +sve -S -disable-O0-optnone

[clang] [AArch64] Cast predicate operand of SVE gather loads/scater stores to the parameter type of the intrinsic (NFC) (PR #71289)

2023-11-13 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/71289 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-13 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: In the last update: - do not set the `FrameSetup` flag for dynamic allocations - avoid back to back probing loops for allocation of SVE locals and non-SVE locals - fold the allocations together and emit a single loop (or no loop)

[clang] [llvm] [clang][AArch64] Pass down stack clash protection options to LLVM/Backend (PR #68993)

2023-11-13 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: Ping? https://github.com/llvm/llvm-project/pull/68993 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [Verifier] Check function attributes related to branch protection (NFC) (PR #70565)

2023-11-11 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: Ping? https://github.com/llvm/llvm-project/pull/70565 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [Verifier] Check function attributes related to branch protection (NFC) (PR #70565)

2023-11-11 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/70565 >From 0fb3e4e96d9377e65d1c794fe0b648ff835748b9 Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Sat, 28 Oct 2023 15:01:36 +0100 Subject: [PATCH 1/4] [Verifier] Check function attributes related to

[llvm] [clang] [clang][AArch64] Pass down stack clash protection options to LLVM/Backend (PR #68993)

2023-11-11 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/68993 >From c55da9c253829610418e5fb22e2b0ecc3f1585b7 Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Sat, 11 Nov 2023 15:27:53 + Subject: [PATCH 1/6] [CFIFixup] Precommit test ahead of multi-block

[clang] [llvm] [clang][AArch64] Pass down stack clash protection options to LLVM/Backend (PR #68993)

2023-11-11 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/68993 >From bfd551c181b8325382247eab80544e69212121aa Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Sat, 11 Nov 2023 11:41:48 + Subject: [PATCH 1/6] [AArch64] Refactor allocation of locals and stack

[clang] [llvm] [AArch64] Stack probing for function prologues (PR #66524)

2023-11-11 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: I'm going to squash the commits which belong to this PR as I don't believe they are useful in isolation anymore and they get in the way of refactoring/rebasing. (Long story short, I did a patch to avoid having two back to back probing loops, then factored out a stack

[clang] [llvm] [AArch64][SVE2.1] Add intrinsics for quadword loads/stores with unscaled offset (PR #70474)

2023-11-10 Thread Momchil Velikov via cfe-commits
@@ -9671,28 +9677,47 @@ Value *CodeGenFunction::EmitSVEMaskedLoad(const CallExpr *E, // The vector type that is returned may be different from the // eventual type loaded from memory. auto VectorTy = cast(ReturnTy); - auto MemoryTy =

[clang] [llvm] [AArch64] Add quadword gather load/scatter store intrinsics with unscaled vector offset (PR #71290)

2023-11-10 Thread Momchil Velikov via cfe-commits
@@ -1457,6 +1457,24 @@ class AdvSIMD_GatherLoad_VS_Intrinsic ], [IntrReadMem]>; +class AdvSIMD_GatherLoadQ_VS_Intrinsic +: DefaultAttrsIntrinsic<[llvm_anyvector_ty], +[ + llvm_nxv1i1_ty, +

[llvm] [clang] [AArch64] Add quadword gather load/scatter store intrinsics with unscaled vector offset (PR #71290)

2023-11-09 Thread Momchil Velikov via cfe-commits
@@ -9497,8 +9500,11 @@ Value *CodeGenFunction::EmitSVEScatterStore(const SVETypeFlags , // mapped to . However, this might be incompatible with the // actual type being stored. For example, when storing doubles (i64) the // predicated should be instead. At the IR level

[clang] [llvm] [AArch64] Add quadword gather load/scatter store intrinsics with unscaled vector offset (PR #71290)

2023-11-09 Thread Momchil Velikov via cfe-commits
@@ -1457,6 +1457,24 @@ class AdvSIMD_GatherLoad_VS_Intrinsic ], [IntrReadMem]>; +class AdvSIMD_GatherLoadQ_VS_Intrinsic +: DefaultAttrsIntrinsic<[llvm_anyvector_ty], +[ + llvm_nxv1i1_ty, +

[clang] [llvm] [AArch64] Add quadword gather load/scatter store intrinsics with unscaled vector offset (PR #71290)

2023-11-09 Thread Momchil Velikov via cfe-commits
@@ -9497,8 +9500,11 @@ Value *CodeGenFunction::EmitSVEScatterStore(const SVETypeFlags , // mapped to . However, this might be incompatible with the // actual type being stored. For example, when storing doubles (i64) the // predicated should be instead. At the IR level

[llvm] [clang] [AArch64] Add SVE2.1 intrinsics for indexed quadword gather loads and scatter stores (PR #70476)

2023-11-06 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov edited https://github.com/llvm/llvm-project/pull/70476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [AArch64] Stack probing for dynamic allocas in SelectionDAG (PR #66525)

2023-11-04 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: Ping? https://github.com/llvm/llvm-project/pull/66525 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [clang][AArch64] Pass down stack clash protection options to LLVM/Backend (PR #68993)

2023-11-04 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: Ping? https://github.com/llvm/llvm-project/pull/68993 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [Verifier] Check function attributes related to branch protection (NFC) (PR #70565)

2023-11-04 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/70565 >From eb47903ad47f4a9e833948424a1c88bc2c72090e Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Sat, 28 Oct 2023 15:01:36 +0100 Subject: [PATCH 1/4] [Verifier] Check function attributes related to

[llvm] [clang] [AArch64][SVE2.1] Add intrinsics for quadword loads/stores with unscaled offset (PR #70474)

2023-11-04 Thread Momchil Velikov via cfe-commits
@@ -9671,28 +9677,47 @@ Value *CodeGenFunction::EmitSVEMaskedLoad(const CallExpr *E, // The vector type that is returned may be different from the // eventual type loaded from memory. auto VectorTy = cast(ReturnTy); - auto MemoryTy =

[llvm] [clang] [AArch64][SVE2.1] Add intrinsics for quadword loads/stores with unscaled offset (PR #70474)

2023-11-04 Thread Momchil Velikov via cfe-commits
@@ -2614,6 +2619,37 @@ def int_aarch64_sve_ld1_pn_x4 : SVE2p1_Load_PN_X4_Intrinsic; def int_aarch64_sve_ldnt1_pn_x2 : SVE2p1_Load_PN_X2_Intrinsic; def int_aarch64_sve_ldnt1_pn_x4 : SVE2p1_Load_PN_X4_Intrinsic; +// +// SVE2.1 - Contiguous loads to quadword (single vector) +//

[llvm] [clang] [AArch64][SVE2.1] Add intrinsics for quadword loads/stores with unscaled offset (PR #70474)

2023-11-04 Thread Momchil Velikov via cfe-commits
@@ -9702,17 +9727,34 @@ Value *CodeGenFunction::EmitSVEMaskedStore(const CallExpr *E, auto VectorTy = cast(Ops.back()->getType()); auto MemoryTy = llvm::ScalableVectorType::get(MemEltTy, VectorTy); - Value *Predicate = EmitSVEPredicateCast(Ops[0], MemoryTy); + auto

[llvm] [clang] [AArch64][SVE2.1] Add intrinsics for quadword loads/stores with unscaled offset (PR #70474)

2023-11-04 Thread Momchil Velikov via cfe-commits
@@ -2614,6 +2619,37 @@ def int_aarch64_sve_ld1_pn_x4 : SVE2p1_Load_PN_X4_Intrinsic; def int_aarch64_sve_ldnt1_pn_x2 : SVE2p1_Load_PN_X2_Intrinsic; def int_aarch64_sve_ldnt1_pn_x4 : SVE2p1_Load_PN_X4_Intrinsic; +// +// SVE2.1 - Contiguous loads to quadword (single vector) +//

[llvm] [clang] [AArch64][SVE2.1] Add intrinsics for quadword loads/stores with unscaled offset (PR #70474)

2023-11-04 Thread Momchil Velikov via cfe-commits
@@ -9671,28 +9677,47 @@ Value *CodeGenFunction::EmitSVEMaskedLoad(const CallExpr *E, // The vector type that is returned may be different from the // eventual type loaded from memory. auto VectorTy = cast(ReturnTy); - auto MemoryTy =

[clang] [AArch64] Cast predicate operand of SVE gather loads/scater stores to the parameter type of the intrinsic (NFC) (PR #71289)

2023-11-04 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov created https://github.com/llvm/llvm-project/pull/71289 When emitting LLVM IR for gather loads/scatter stores, the predicate parameter is cast to a type that depends on the loaded, resp. stored type. That's correct for operation where we have a predicate per

[clang] [AArch64] Implement reinterpret builtins for SVE vector tuples (PR #69598)

2023-11-03 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov closed https://github.com/llvm/llvm-project/pull/69598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64] Implement reinterpret builtins for SVE vector tuples (PR #69598)

2023-11-03 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: Rebased a couple of times to resolve merge conflicts. https://github.com/llvm/llvm-project/pull/69598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SVE2.1][Clang][LLVM]Add BFloat16 builtin in Clang and LLVM intrinisc (PR #70362)

2023-11-01 Thread Momchil Velikov via cfe-commits
momchil-velikov wrote: > Co-author: Matthew Devereau Should be "Co-authored-by:" https://github.com/llvm/llvm-project/pull/70362 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AArch64] Pass down stack clash protection options to LLVM/Backend (PR #68993)

2023-10-28 Thread Momchil Velikov via cfe-commits
@@ -85,17 +90,32 @@ static bool isPrologueCFIInstruction(const MachineInstr ) { MI.getFlag(MachineInstr::FrameSetup); } -static bool containsPrologue(const MachineBasicBlock ) { - return llvm::any_of(MBB.instrs(), isPrologueCFIInstruction); -} - static bool

[clang] [clang][AArch64] Pass down stack clash protection options to LLVM/Backend (PR #68993)

2023-10-28 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov updated https://github.com/llvm/llvm-project/pull/68993 >From ed580b95157d7f423c5384fa2d51af00f1359a10 Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Mon, 2 Oct 2023 14:46:27 +0100 Subject: [PATCH 1/3] [CFIFixup] Allow function prologues to span more

[clang] [AArch64] Implement reinterpret builtins for SVE vector tuples (PR #69598)

2023-10-27 Thread Momchil Velikov via cfe-commits
@@ -383,6 +381,20 @@ class SVEEmitter { SmallVectorImpl> ); }; +const std::array SVEEmitter::Reinterprets = +{{{SVEType("c"), "s8"}, momchil-velikov wrote: Done https://github.com/llvm/llvm-project/pull/69598

[clang] [AArch64] Implement reinterpret builtins for SVE vector tuples (PR #69598)

2023-10-27 Thread Momchil Velikov via cfe-commits
@@ -64,26 +65,29 @@ class ImmCheck { }; class SVEType { - TypeSpec TS; bool Float, Signed, Immediate, Void, Constant, Pointer, BFloat; bool DefaultType, IsScalable, Predicate, PredicatePattern, PrefetchOp, Svcount; unsigned Bitwidth, ElementBitwidth,

<    1   2   3   >