[clang] [llvm] [Intrinsics][AArch64] Add intrinsic to mask off aliasing vector lanes (PR #117007)

2025-01-16 Thread Sam Tebbs via cfe-commits
@@ -2033,6 +2041,25 @@ bool AArch64TargetLowering::shouldExpandGetActiveLaneMask(EVT ResVT, return false; } +bool AArch64TargetLowering::shouldExpandGetAliasLaneMask( SamTebbs33 wrote: It certainly can. Done. https://github.com/llvm/llvm-project/pull/1170

[clang] [llvm] [Intrinsics][AArch64] Add intrinsic to mask off aliasing vector lanes (PR #117007)

2025-01-16 Thread Sam Tebbs via cfe-commits
SamTebbs33 wrote: > If you want to upgrade the whilewr intrinsics (which I think sounds OK to > me), then it will need auto-update code something like in > https://github.com/llvm/llvm-project/pull/120363/files#diff-0c0305d510a076cef711c006c1d9fd78c95cade1f597d21ee46fd753e6982316. > It might b

[clang] [llvm] [Intrinsics][AArch64] Add intrinsic to mask off aliasing vector lanes (PR #117007)

2025-01-16 Thread Sam Tebbs via cfe-commits
@@ -567,6 +567,9 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const { case ISD::EXPERIMENTAL_VECTOR_HISTOGRAM: return "histogram"; + case ISD::EXPERIMENTAL_ALIAS_LANE_MASK: +return "alias_mask"; SamTebbs33 wrote: Done. https://g

[clang] [llvm] [LV] Mask off possibly aliasing vector lanes (PR #100579)

2024-09-19 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 edited https://github.com/llvm/llvm-project/pull/100579 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LV] Mask off possibly aliasing vector lanes (PR #100579)

2024-09-19 Thread Sam Tebbs via cfe-commits
@@ -2725,9 +2725,17 @@ class VPAliasLaneMaskRecipe : public VPSingleDefRecipe { /// Get the VPValue* for the pointer being read from VPValue *getSourceValue() const { return getOperand(0); } + // Get the size of the element(s) accessed by the pointers + unsigned getAcces

[clang] [llvm] [LV] Mask off possibly aliasing vector lanes (PR #100579)

2024-09-04 Thread Sam Tebbs via cfe-commits
@@ -428,6 +431,85 @@ Value *VPInstruction::generatePerPart(VPTransformState &State, unsigned Part) { {PredTy, ScalarTC->getType()}, {VIVElem0, ScalarTC}, nullptr, Name); } + case VPInstruction::AliasLaneM

[clang] [llvm] [LV] Mask off possibly aliasing vector lanes (PR #100579)

2024-09-04 Thread Sam Tebbs via cfe-commits
@@ -2778,6 +2808,60 @@ void VPWidenPointerInductionRecipe::print(raw_ostream &O, const Twine &Indent, } #endif +void VPAliasLaneMaskRecipe::execute(VPTransformState &State) { + IRBuilderBase Builder = State.Builder; + Value *SinkValue = State.get(getSinkValue(), 0, true); +

[clang] [llvm] [LV] Mask off possibly aliasing vector lanes (PR #100579)

2024-08-27 Thread Sam Tebbs via cfe-commits
SamTebbs33 wrote: Ping. https://github.com/llvm/llvm-project/pull/100579 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LV] Mask off possibly aliasing vector lanes (PR #100579)

2024-08-15 Thread Sam Tebbs via cfe-commits
@@ -428,6 +431,85 @@ Value *VPInstruction::generatePerPart(VPTransformState &State, unsigned Part) { {PredTy, ScalarTC->getType()}, {VIVElem0, ScalarTC}, nullptr, Name); } + case VPInstruction::AliasLaneM

[clang] [llvm] [HLSL][DXIL][SPIRV] Create llvm dot intrinsic and use for HLSL (PR #102872)

2024-08-13 Thread Sam Tebbs via cfe-commits
SamTebbs33 wrote: > > It would seem like a "udot" can be represented already as > > `vecreduce.add(mul(zext, zext))`, and fdot is simpler still. Is there any > > particular reason to add a new intrinsic for it if it is already > > representable as a vecreduce? And it would feel like a shame if

[clang] [llvm] [LV] Mask off possibly aliasing vector lanes (PR #100579)

2024-08-09 Thread Sam Tebbs via cfe-commits
@@ -9838,16 +9902,33 @@ bool LoopVectorizePass::processLoop(Loop *L) { ElementCount UserVF = Hints.getWidth(); unsigned UserIC = Hints.getInterleave(); + bool AddBranchWeights = + hasBranchWeightMD(*L->getLoopLatch()->getTerminator()); + GeneratedRTChecks Checks(*PS

[clang] [llvm] [LV] Mask off possibly aliasing vector lanes (PR #100579)

2024-08-07 Thread Sam Tebbs via cfe-commits
@@ -9838,16 +9902,33 @@ bool LoopVectorizePass::processLoop(Loop *L) { ElementCount UserVF = Hints.getWidth(); unsigned UserIC = Hints.getInterleave(); + bool AddBranchWeights = + hasBranchWeightMD(*L->getLoopLatch()->getTerminator()); + GeneratedRTChecks Checks(*PS

[clang] [llvm] [LV] Mask off possibly aliasing vector lanes (PR #100579)

2024-08-07 Thread Sam Tebbs via cfe-commits
@@ -9,11 +9,11 @@ define void @same_step_and_size(ptr %a, ptr %b, i64 %n) { ; CHECK-NEXT:[[A2:%.*]] = ptrtoint ptr [[A:%.*]] to i64 ; CHECK-NEXT:[[B1:%.*]] = ptrtoint ptr [[B:%.*]] to i64 ; CHECK-NEXT:[[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[N:%.*]], 4 -; CHECK-NEXT

[clang] [llvm] [LV] Mask off possibly aliasing vector lanes (PR #100579)

2024-08-07 Thread Sam Tebbs via cfe-commits
@@ -16,8 +16,8 @@ #include "llvm/ADT/EquivalenceClasses.h" #include "llvm/Analysis/LoopAnalysisManager.h" -#include "llvm/Analysis/ScalarEvolutionExpressions.h" #include "llvm/IR/DiagnosticInfo.h" +#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h" Sa

[clang] [llvm] [LV] Mask off possibly aliasing vector lanes (PR #100579)

2024-08-07 Thread Sam Tebbs via cfe-commits
@@ -428,6 +431,85 @@ Value *VPInstruction::generatePerPart(VPTransformState &State, unsigned Part) { {PredTy, ScalarTC->getType()}, {VIVElem0, ScalarTC}, nullptr, Name); } + case VPInstruction::AliasLaneM

[clang] [llvm] [LV] Mask off possibly aliasing vector lanes (PR #100579)

2024-08-07 Thread Sam Tebbs via cfe-commits
@@ -0,0 +1,404 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4 SamTebbs33 wrote: That's true, I've removed this file and have started work on adding a test to the llvm-test-suite to replace it. A statistic

[clang] [llvm] [LV] Mask off possibly aliasing vector lanes (PR #100579)

2024-08-07 Thread Sam Tebbs via cfe-commits
@@ -8520,7 +8561,29 @@ LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VFRange &Range) { // When not folding the tail, we know that the induction increment will not // overflow. bool HasNUW = Style == TailFoldingStyle::None; - addCanonicalIVRecipes(*Plan, Legal->

[clang] [llvm] [LV] Mask off possibly aliasing vector lanes (PR #100579)

2024-08-02 Thread Sam Tebbs via cfe-commits
@@ -448,6 +448,20 @@ struct PointerDiffInfo { NeedsFreeze(NeedsFreeze) {} }; +/// A pair of pointers that could overlap across a loop iteration. SamTebbs33 wrote: That sounds good to me. I originally put it here so it was next to the related `Pointer

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

2024-02-23 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 approved this pull request. https://github.com/llvm/llvm-project/pull/82648 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-02-23 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 approved this pull request. https://github.com/llvm/llvm-project/pull/82649 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

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

2024-02-22 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 closed https://github.com/llvm/llvm-project/pull/77936 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-02-21 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 updated https://github.com/llvm/llvm-project/pull/77936 >From 7314429a203900a8f555e1b0471fdd4cfd4d8d03 Mon Sep 17 00:00:00 2001 From: Samuel Tebbs Date: Wed, 10 Jan 2024 14:57:04 + Subject: [PATCH 01/18] [Clang][SME] Detect always_inline used with mismatched s

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

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

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

2024-02-21 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 edited https://github.com/llvm/llvm-project/pull/77936 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

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

2024-02-21 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 approved this pull request. https://github.com/llvm/llvm-project/pull/78169 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-02-14 Thread Sam Tebbs via cfe-commits
@@ -814,6 +820,49 @@ Address AArch64ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr, /*allowHigherAlign*/ false); } +class SMEAttributes { +public: + bool IsStreaming = false; + bool IsStreamingCompatible = false; + bool HasNewZA = f

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

2024-02-14 Thread Sam Tebbs via cfe-commits
@@ -814,6 +820,49 @@ Address AArch64ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr, /*allowHigherAlign*/ false); } +class SMEAttributes { SamTebbs33 wrote: Done. https://github.com/llvm/llvm-project/pull/77936 __

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

2024-02-14 Thread Sam Tebbs via cfe-commits
@@ -0,0 +1,7 @@ +// RUN: %clang --target=aarch64-none-linux-gnu -march=armv9-a+sme -O3 -S -Xclang -verify %s SamTebbs33 wrote: Done. https://github.com/llvm/llvm-project/pull/77936 ___ cfe-commits mailing list cfe-com

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

2024-02-14 Thread Sam Tebbs via cfe-commits
@@ -814,6 +820,49 @@ Address AArch64ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr, /*allowHigherAlign*/ false); } +class SMEAttributes { +public: + bool IsStreaming = false; + bool IsStreamingCompatible = false; + bool HasNewZA = f

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

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

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

2024-02-14 Thread Sam Tebbs via cfe-commits
@@ -0,0 +1,6 @@ +// RUN: %clang --target=aarch64-none-linux-gnu -march=armv9-a+sme -O3 -S -Xclang -verify %s SamTebbs33 wrote: Done. I originally didn't as the frontend bails out once it's printed all the errors for one function (-ferror-limit doesn't help here

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

2024-02-14 Thread Sam Tebbs via cfe-commits
@@ -0,0 +1,13 @@ +// RUN: %clang --target=aarch64-none-linux-gnu -march=armv9-a+sme -O3 -S -Xclang -verify %s + +// Conflicting attributes when using always_inline +__attribute__((always_inline)) SamTebbs33 wrote: Done. https://github.com/llvm/llvm-project/pull

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

2024-02-14 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 updated https://github.com/llvm/llvm-project/pull/77936 >From 7314429a203900a8f555e1b0471fdd4cfd4d8d03 Mon Sep 17 00:00:00 2001 From: Samuel Tebbs Date: Wed, 10 Jan 2024 14:57:04 + Subject: [PATCH 01/17] [Clang][SME] Detect always_inline used with mismatched s

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

2024-01-30 Thread Sam Tebbs via cfe-commits
@@ -814,6 +821,93 @@ Address AArch64ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr, /*allowHigherAlign*/ false); } +class SMEAttributes { +public: + bool IsStreaming = false; + bool IsStreamingBody = false; + bool IsStreamingCompati

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

2024-01-30 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 updated https://github.com/llvm/llvm-project/pull/77936 >From 7314429a203900a8f555e1b0471fdd4cfd4d8d03 Mon Sep 17 00:00:00 2001 From: Samuel Tebbs Date: Wed, 10 Jan 2024 14:57:04 + Subject: [PATCH 01/12] [Clang][SME] Detect always_inline used with mismatched s

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

2024-01-25 Thread Sam Tebbs via cfe-commits
SamTebbs33 wrote: Agreed. I tried moving it to Support but that introduced a dependency cycle, so I re-implemented some of the SMEAttributes logic in-place instead. https://github.com/llvm/llvm-project/pull/77936 ___

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

2024-01-24 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 updated https://github.com/llvm/llvm-project/pull/77936 >From 7314429a203900a8f555e1b0471fdd4cfd4d8d03 Mon Sep 17 00:00:00 2001 From: Samuel Tebbs Date: Wed, 10 Jan 2024 14:57:04 + Subject: [PATCH 1/8] [Clang][SME] Detect always_inline used with mismatched str

[clang] [clang] Add missing streaming attributes to SVE builtins (PR #79134)

2024-01-23 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 closed https://github.com/llvm/llvm-project/pull/79134 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Add diagnostics for builtins that use ZT0. (PR #79140)

2024-01-23 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 approved this pull request. https://github.com/llvm/llvm-project/pull/79140 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add missing streaming attributes to SVE builtins (PR #79134)

2024-01-23 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 created https://github.com/llvm/llvm-project/pull/79134 This patch adds `IsStreamingCompatible` or `IsStreamingOrSVE2p1` to the SVE builtins that missed them. >From 09e6c0dd9b589481bf226b04bafe4da645e73bf2 Mon Sep 17 00:00:00 2001 From: Samuel Tebbs Date: Tue, 23

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

2024-01-19 Thread Sam Tebbs via cfe-commits
@@ -814,6 +821,42 @@ Address AArch64ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr, /*allowHigherAlign*/ false); } +void AArch64TargetCodeGenInfo::checkFunctionCallABI( +CodeGenModule &CGM, SourceLocation CallLoc, const FunctionDec

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

2024-01-19 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 edited https://github.com/llvm/llvm-project/pull/77936 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-01-19 Thread Sam Tebbs via cfe-commits
SamTebbs33 wrote: > clang has never emitted diagnostics for failure to inline an always_inline > function. But if gcc is doing it, maybe defaulting to an error isn't such a > big deal. clang does actually emit an error when it finds always_inline on a callee with different target attributes t

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

2024-01-18 Thread Sam Tebbs via cfe-commits
@@ -812,6 +819,24 @@ Address AArch64ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr, /*allowHigherAlign*/ false); } +void AArch64TargetCodeGenInfo::checkFunctionCallABI( +CodeGenModule &CGM, SourceLocation CallLoc, const FunctionDec

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

2024-01-18 Thread Sam Tebbs via cfe-commits
@@ -153,6 +155,11 @@ class AArch64TargetCodeGenInfo : public TargetCodeGenInfo { } return TargetCodeGenInfo::isScalarizableAsmOperand(CGF, Ty); } + + void checkFunctionCallABI(CodeGenModule &CGM, SourceLocation CallLoc, SamTebbs33 wrote: It's called

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

2024-01-18 Thread Sam Tebbs via cfe-commits
@@ -812,6 +819,24 @@ Address AArch64ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr, /*allowHigherAlign*/ false); } +void AArch64TargetCodeGenInfo::checkFunctionCallABI( +CodeGenModule &CGM, SourceLocation CallLoc, const FunctionDec

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

2024-01-18 Thread Sam Tebbs via cfe-commits
@@ -3145,7 +3138,7 @@ bool Sema::ParseSVEImmChecks( return HasError; } -static ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD) { +Sema::ArmStreamingType Sema::getArmStreamingFnType(const FunctionDecl *FD) { SamTebbs33 wrote: Done. https://gi

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

2024-01-18 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 updated https://github.com/llvm/llvm-project/pull/77936 >From 7314429a203900a8f555e1b0471fdd4cfd4d8d03 Mon Sep 17 00:00:00 2001 From: Samuel Tebbs Date: Wed, 10 Jan 2024 14:57:04 + Subject: [PATCH 1/7] [Clang][SME] Detect always_inline used with mismatched str

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

2024-01-18 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 updated https://github.com/llvm/llvm-project/pull/77936 >From bbc6c11cd3def5acbb2ba2f2ddc45df2c399f9d6 Mon Sep 17 00:00:00 2001 From: Samuel Tebbs Date: Wed, 10 Jan 2024 14:57:04 + Subject: [PATCH 1/6] [Clang][SME] Detect always_inline used with mismatched str

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

2024-01-17 Thread Sam Tebbs via cfe-commits
@@ -279,6 +279,8 @@ def err_builtin_needs_feature : Error<"%0 needs target feature %1">; def err_function_needs_feature : Error< "always_inline function %1 requires target feature '%2', but would " "be inlined into function %0 that is compiled without support for '%2'">; +

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

2024-01-17 Thread Sam Tebbs via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang --target=aarch64-none-linux-gnu -march=armv9-a+sme -O3 -S -Xclang -verify %s + +// Conflicting attributes when using always_inline +__attribute__((always_inline)) __arm_locally_streaming +int inlined_fn_local(void) { +return 42; +} ---

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

2024-01-17 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 updated https://github.com/llvm/llvm-project/pull/77936 >From bbc6c11cd3def5acbb2ba2f2ddc45df2c399f9d6 Mon Sep 17 00:00:00 2001 From: Samuel Tebbs Date: Wed, 10 Jan 2024 14:57:04 + Subject: [PATCH 1/5] [Clang][SME] Detect always_inline used with mismatched str

[clang] [Clang] Rename and enable boolean get, set, create and undef for sme2 (PR #77338)

2024-01-15 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 closed https://github.com/llvm/llvm-project/pull/77338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-01-15 Thread Sam Tebbs via cfe-commits
@@ -812,6 +819,23 @@ Address AArch64ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr, /*allowHigherAlign*/ false); } +void AArch64TargetCodeGenInfo::checkFunctionCallABI( +CodeGenModule &CGM, SourceLocation CallLoc, const FunctionDec

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

2024-01-15 Thread Sam Tebbs via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang --target=aarch64-none-linux-gnu -march=armv9-a+sme -O3 -S -Xclang -verify %s + +// Conflicting attributes when using always_inline +__attribute__((always_inline)) __arm_locally_streaming +int inlined_fn_local(void) { +return 42; +} ---

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

2024-01-15 Thread Sam Tebbs via cfe-commits
@@ -279,6 +279,8 @@ def err_builtin_needs_feature : Error<"%0 needs target feature %1">; def err_function_needs_feature : Error< "always_inline function %1 requires target feature '%2', but would " "be inlined into function %0 that is compiled without support for '%2'">; +

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

2024-01-15 Thread Sam Tebbs via cfe-commits
@@ -812,6 +819,23 @@ Address AArch64ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr, /*allowHigherAlign*/ false); } +void AArch64TargetCodeGenInfo::checkFunctionCallABI( +CodeGenModule &CGM, SourceLocation CallLoc, const FunctionDec

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

2024-01-15 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 updated https://github.com/llvm/llvm-project/pull/77936 >From bbc6c11cd3def5acbb2ba2f2ddc45df2c399f9d6 Mon Sep 17 00:00:00 2001 From: Samuel Tebbs Date: Wed, 10 Jan 2024 14:57:04 + Subject: [PATCH 1/3] [Clang][SME] Detect always_inline used with mismatched str

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

2024-01-15 Thread Sam Tebbs via cfe-commits
@@ -812,6 +819,23 @@ Address AArch64ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr, /*allowHigherAlign*/ false); } +void AArch64TargetCodeGenInfo::checkFunctionCallABI( +CodeGenModule &CGM, SourceLocation CallLoc, const FunctionDec

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

2024-01-12 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 updated https://github.com/llvm/llvm-project/pull/77936 >From bbc6c11cd3def5acbb2ba2f2ddc45df2c399f9d6 Mon Sep 17 00:00:00 2001 From: Samuel Tebbs Date: Wed, 10 Jan 2024 14:57:04 + Subject: [PATCH 1/2] [Clang][SME] Detect always_inline used with mismatched str

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

2024-01-12 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 edited https://github.com/llvm/llvm-project/pull/77936 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-01-12 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 created https://github.com/llvm/llvm-project/pull/77936 This patch adds an error that is emitted when a streaming function is marked as always_inline and is called from a non-streaming function. >From bbc6c11cd3def5acbb2ba2f2ddc45df2c399f9d6 Mon Sep 17 00:00:00 20

[clang] [Clang] Rename and enable boolean get, set, create and undef for sme2 (PR #77338)

2024-01-11 Thread Sam Tebbs via cfe-commits
@@ -0,0 +1,35 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4 +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -O2 -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileC

[clang] [Clang] Rename and enable boolean get, set, create and undef for sme2 (PR #77338)

2024-01-11 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 updated https://github.com/llvm/llvm-project/pull/77338 >From 091048a63e9c4ac21fd38b8e7483953c602c714f Mon Sep 17 00:00:00 2001 From: Sam Tebbs Date: Fri, 5 Jan 2024 10:47:01 + Subject: [PATCH 1/3] [Clang] Rename and enable boolean get, set, create and undef f

[clang] [Clang] Rename and enable boolean get, set, create and undef for sme2 (PR #77338)

2024-01-10 Thread Sam Tebbs via cfe-commits
@@ -1321,12 +1321,17 @@ def SVSET_3_BF16 : SInst<"svset3[_{d}]", "33id", "b", MergeNone, "", [IsTupleSet def SVSET_4_BF16 : SInst<"svset4[_{d}]", "44id", "b", MergeNone, "", [IsTupleSet], [ImmCheck<1, ImmCheck0_3>]>; } -let TargetGuard = "sve2p1" in { - def SVGET_2_B : SIns

[clang] [Clang] Rename and enable boolean get, set, create and undef for sme2 (PR #77338)

2024-01-10 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 updated https://github.com/llvm/llvm-project/pull/77338 >From 091048a63e9c4ac21fd38b8e7483953c602c714f Mon Sep 17 00:00:00 2001 From: Sam Tebbs Date: Fri, 5 Jan 2024 10:47:01 + Subject: [PATCH 1/2] [Clang] Rename and enable boolean get, set, create and undef f

[clang] [Clang] Rename and enable boolean get, set, create and undef for sme2 (PR #77338)

2024-01-08 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 created https://github.com/llvm/llvm-project/pull/77338 This patch renames the get, set, create and undef functions that deal with tuples of booleans to match the ACLE at https://github.com/ARM-software/acle/pull/257/files . It also enables them for SME2. >From 0

[clang] 567941b - [Clang][SME] Remove unused HasSVE2p1 variable

2024-01-05 Thread Sam Tebbs via cfe-commits
Author: Sam Tebbs Date: 2024-01-05T11:17:56Z New Revision: 567941bcc3b1fc3b1d2a902cf7ae2e173247a45f URL: https://github.com/llvm/llvm-project/commit/567941bcc3b1fc3b1d2a902cf7ae2e173247a45f DIFF: https://github.com/llvm/llvm-project/commit/567941bcc3b1fc3b1d2a902cf7ae2e173247a45f.diff LOG: [Cl

[clang] [Clang][SME] Add IsStreamingOrSVE2p1 (PR #76975)

2024-01-05 Thread Sam Tebbs via cfe-commits
@@ -50,6 +50,7 @@ class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public TargetInfo { bool HasMatMul = false; bool HasBFloat16 = false; bool HasSVE2 = false; + bool HasSVE2p1 = false; SamTebbs33 wrote: Thanks I saw this too. Testing the fix as we spe

[clang] [Clang][SME] Add IsStreamingOrSVE2p1 (PR #76975)

2024-01-05 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 closed https://github.com/llvm/llvm-project/pull/76975 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang][SME] Add IsStreamingOrSVE2p1" (PR #76973)

2024-01-04 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 closed https://github.com/llvm/llvm-project/pull/76973 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang][SME] Add IsStreamingOrSVE2p1" (PR #76973)

2024-01-04 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 created https://github.com/llvm/llvm-project/pull/76973 Reverts llvm/llvm-project#75958 I mistakenly included a commit from my local main after rebasing. >From d63f848e75b66ae2e5915ada4bd5b370e05f9829 Mon Sep 17 00:00:00 2001 From: Sam Tebbs Date: Thu, 4 Jan 2024

[clang] [Clang][SME] Add IsStreamingOrSVE2p1 (PR #75958)

2024-01-04 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 closed https://github.com/llvm/llvm-project/pull/75958 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][SME] Add IsStreamingOrSVE2p1 (PR #75958)

2024-01-04 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 edited https://github.com/llvm/llvm-project/pull/75958 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][SME] Add IsStreamingOrSVE2p1 (PR #75958)

2024-01-04 Thread Sam Tebbs via cfe-commits
@@ -1109,10 +1109,10 @@ def SVPFALSE : SInst<"svpfalse[_b]", "Pv", "", MergeNone, "", [IsOverloadNone, I def SVPTRUE_PAT : SInst<"svptrue_pat_{d}", "PI", "PcPsPiPl", MergeNone, "aarch64_sve_ptrue", [IsStreamingCompatible]>; def SVPTRUE : SInst<"svptrue_{d}", "Pv", "Pc

[clang] [Clang][SME] Add IsStreamingOrSVE2p1 (PR #75958)

2023-12-20 Thread Sam Tebbs via cfe-commits
@@ -2069,21 +2070,20 @@ def SVDOT_LANE_X2_U : SInst<"svdot_lane[_{d}_{2}_{3}]", "ddhhi", "Ui", MergeNone def SVDOT_LANE_X2_F : SInst<"svdot_lane[_{d}_{2}_{3}]", "ddhhi", "f", MergeNone, "aarch64_sve_fdot_lane_x2", [], [ImmCheck<3, ImmCheck0_3>]>; } -let TargetGuard = "sve2p

[clang] [Clang][SME] Add IsStreamingOrSVE2p1 (PR #75958)

2023-12-20 Thread Sam Tebbs via cfe-commits
@@ -10,6 +10,10 @@ // RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu \ // RUN: -target-feature +sve2p1 -S -O1 -Werror -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK // RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-

[clang] [Clang][SME] Add IsStreamingOrSVE2p1 (PR #75958)

2023-12-20 Thread Sam Tebbs via cfe-commits
@@ -1,14 +1,20 @@ // 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 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p

[clang] [Clang][SME] Add IsStreamingOrSVE2p1 (PR #75958)

2023-12-20 Thread Sam Tebbs via cfe-commits
@@ -11,10 +11,16 @@ // RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu -target-feature +sve2p1 \ // RUN: -S -disable-O0-optnone -Werror -Wall -o /dev/null %s // RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu -target-feature

[clang] [Clang][SME] Add IsStreamingOrSVE2p1 (PR #75958)

2023-12-20 Thread Sam Tebbs via cfe-commits
@@ -8,7 +8,7 @@ // RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s // RUN: %clang_cc1 -f

[clang] [Clang][SME] Add IsStreamingOrSVE2p1 (PR #75958)

2023-12-20 Thread Sam Tebbs via cfe-commits
@@ -679,6 +679,7 @@ bool AArch64TargetInfo::hasFeature(StringRef Feature) const { .Case("f32mm", FPU & SveMode && HasMatmulFP32) .Case("f64mm", FPU & SveMode && HasMatmulFP64) .Case("sve2", FPU & SveMode && HasSVE2) + .Case("sve2p1", HasSVE2p1) -

[clang] [AArch64][SME2] Enable bfm builtins for sme2 (PR #71927)

2023-12-18 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 closed https://github.com/llvm/llvm-project/pull/71927 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64][SME2] Enable bfm builtins for sme2 (PR #71927)

2023-12-18 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 updated https://github.com/llvm/llvm-project/pull/71927 >From 93a02d9af1d7e4f1e23c252d72b20d292927a79f Mon Sep 17 00:00:00 2001 From: Samuel Tebbs Date: Thu, 9 Nov 2023 17:39:26 + Subject: [PATCH 1/7] [AArch64][SME2] Enable bfm builtings for sme2 This patch en

[clang] [Clang][SME] Warn when a function doesn't have ZA state (PR #75805)

2023-12-18 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 closed https://github.com/llvm/llvm-project/pull/75805 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][SME2] Enable multi-vector loads & stores for SME2 (PR #75821)

2023-12-18 Thread Sam Tebbs via cfe-commits
SamTebbs33 wrote: Should these builtins be `IsStreamingCompatible` until we add `IsStreamingOrSVE2p1`? https://github.com/llvm/llvm-project/pull/75821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [AArch64][SME2] Enable bfm builtins for sme2 (PR #71927)

2023-12-18 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 updated https://github.com/llvm/llvm-project/pull/71927 >From 93a02d9af1d7e4f1e23c252d72b20d292927a79f Mon Sep 17 00:00:00 2001 From: Samuel Tebbs Date: Thu, 9 Nov 2023 17:39:26 + Subject: [PATCH 1/6] [AArch64][SME2] Enable bfm builtings for sme2 This patch en

[clang] [AArch64][SME2] Add SME2 MLA/MLS builtins. (PR #75584)

2023-12-18 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/75584 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64][SME2] Enable bfm builtins for sme2 (PR #71927)

2023-12-18 Thread Sam Tebbs via cfe-commits
SamTebbs33 wrote: Rebased to fix a merge conflict and made the builtins temporarily `IsStreamingCompatible`. https://github.com/llvm/llvm-project/pull/71927 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [AArch64][SME2] Enable bfm builtins for sme2 (PR #71927)

2023-12-18 Thread Sam Tebbs via cfe-commits
@@ -1992,3 +1986,12 @@ 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", MergeNon

[clang] [AArch64][SME2] Enable bfm builtins for sme2 (PR #71927)

2023-12-18 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 updated https://github.com/llvm/llvm-project/pull/71927 >From 93a02d9af1d7e4f1e23c252d72b20d292927a79f Mon Sep 17 00:00:00 2001 From: Samuel Tebbs Date: Thu, 9 Nov 2023 17:39:26 + Subject: [PATCH 1/5] [AArch64][SME2] Enable bfm builtings for sme2 This patch en

[clang] [AArch64][SME] Warn when using a streaming builtin from a non-streaming function (PR #75487)

2023-12-18 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 closed https://github.com/llvm/llvm-project/pull/75487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64][SME] Warn when using a streaming builtin from a non-streaming function (PR #75487)

2023-12-18 Thread Sam Tebbs via cfe-commits
SamTebbs33 wrote: @nico I tried to cherry-pick your commit (c60663d128f8e0dccd418bdf16ecc403b96aa74a) into my branch but for some reason it was always empty. It might be best for you to try recommitting it now. https://github.com/llvm/llvm-project/pull/75487 __

[clang] [AArch64][SME] Warn when using a streaming builtin from a non-streaming function (PR #75487)

2023-12-15 Thread Sam Tebbs via cfe-commits
@@ -1702,6 +1705,62 @@ void SVEEmitter::createSMERangeChecks(raw_ostream &OS) { OS << "#endif\n\n"; } +void SVEEmitter::createStreamingAttrs(raw_ostream &OS, ACLEKind Kind) { + std::vector RV = Records.getAllDerivedDefinitions("Inst"); + SmallVector, 128> Defs; + for (aut

[clang] [AArch64][SME] Warn when using a streaming builtin from a non-streaming function (PR #75487)

2023-12-15 Thread Sam Tebbs via cfe-commits
SamTebbs33 wrote: > If it's not too much trouble, could you `git cherry-pick > c60663d128f8e0dccd418bdf16ecc403b96aa74a` into this? (Cool if not, ofc.) Sure, I can do that. Would you also mind attempting to reproduce the compile time with the latest commit, just to make sure it fixes the issue

[clang] [AArch64][SME] Warn when using a streaming builtin from a non-streaming function (PR #74064)

2023-12-14 Thread Sam Tebbs via cfe-commits
SamTebbs33 wrote: New PR at https://github.com/llvm/llvm-project/pull/75487 https://github.com/llvm/llvm-project/pull/74064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64][SME] Warn when using a streaming builtin from a non-streaming function (PR #75487)

2023-12-14 Thread Sam Tebbs via cfe-commits
SamTebbs33 wrote: Commit [6dc8fa2](https://github.com/llvm/llvm-project/pull/75487/commits/6dc8fa2c89159d234d9477358dd1ce1cbf059865) is the only one with new content. [d9a8da1](https://github.com/llvm/llvm-project/pull/75487/commits/d9a8da139e93f0b3259cb22d7f4c55ed46f9f265) is the exact same

[clang] [AArch64][SME] Warn when using a streaming builtin from a non-streaming function (PR #74064)

2023-12-14 Thread Sam Tebbs via cfe-commits
SamTebbs33 wrote: Thanks for reporting that Nico. I've reverted the patch and will work on improving compile time. I like your idea Sander. https://github.com/llvm/llvm-project/pull/74064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] Revert "[AArch64][SME] Warn when using a streaming builtin from a non-streaming function" (PR #75449)

2023-12-14 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 closed https://github.com/llvm/llvm-project/pull/75449 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   >