[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-10 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea closed https://github.com/llvm/llvm-project/pull/94279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-10 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/94279 >From a413428bb0fdcd45b4a251e385b6cc00ff6a0a2c Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Mon, 3 Jun 2024 19:57:49 +0100 Subject: [PATCH 1/4] [AArch64] Decouple feature dependency expansion. The

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-06 Thread David Green via cfe-commits
davemgreen wrote: Yeah I had just seen that error message before you edited your comment. There are some examples of neon I found in a quick search, which were presumably added for AArch32: https://github.com/aaru-dps/Aaru.Checksums.Native/blob/bd5051ce181b225a7662bfb764ebcc5cbe7542b2/simd.h#L1

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-06 Thread Alexandros Lamprineas via cfe-commits
labrinea wrote: > Not supporting "neon" as a name would seem like a mistake if it was removed, > but I don't believe this patch does that. It does https://github.com/llvm/llvm-project/pull/94279 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-05 Thread David Green via cfe-commits
https://github.com/davemgreen commented: > LGTM. The main change to point out is that the target attribute will no > longer accept internal feature names. I don't think it should ever have done > so, but we should get input from others. @davemgreen? There are references to > existing code in [

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-05 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea edited https://github.com/llvm/llvm-project/pull/94279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-05 Thread Alexandros Lamprineas via cfe-commits
@@ -1110,23 +1071,26 @@ ParsedTargetAttr AArch64TargetInfo::parseTargetAttr(StringRef Features) const { bool FoundArch = false; auto SplitAndAddFeatures = [](StringRef FeatString, -std::vector &Features) { +s

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-05 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/94279 >From a413428bb0fdcd45b4a251e385b6cc00ff6a0a2c Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Mon, 3 Jun 2024 19:57:49 +0100 Subject: [PATCH 1/4] [AArch64] Decouple feature dependency expansion. The

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-05 Thread Tomas Matheson via cfe-commits
@@ -48,5 +48,5 @@ int test_versions() { return code(); } // CHECK: attributes #0 = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" } -// CHECK: attributes #1 = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-b

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-05 Thread Tomas Matheson via cfe-commits
@@ -13665,9 +13665,9 @@ QualType ASTContext::getCorrespondingSignedFixedPointType(QualType Ty) const { } // Given a list of FMV features, add each of their backend features to the list. tmatheson-arm wrote: ```suggestion // Given a list of FMV features, ret

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-05 Thread Tomas Matheson via cfe-commits
https://github.com/tmatheson-arm edited https://github.com/llvm/llvm-project/pull/94279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-05 Thread Tomas Matheson via cfe-commits
https://github.com/tmatheson-arm approved this pull request. LGTM. The main change to point out is that the target attribute will no longer accept internal feature names. I don't think it should ever have done so, but we should get input from others. @davemgreen? There are references to existin

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-05 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/94279 >From a413428bb0fdcd45b4a251e385b6cc00ff6a0a2c Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Mon, 3 Jun 2024 19:57:49 +0100 Subject: [PATCH 1/3] [AArch64] Decouple feature dependency expansion. The

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-05 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/94279 >From a413428bb0fdcd45b4a251e385b6cc00ff6a0a2c Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Mon, 3 Jun 2024 19:57:49 +0100 Subject: [PATCH 1/2] [AArch64] Decouple feature dependency expansion. The

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-05 Thread Alexandros Lamprineas via cfe-commits
@@ -250,13 +248,17 @@ void AArch64::ExtensionSet::addArchDefaults(const ArchInfo &Arch) { bool AArch64::ExtensionSet::parseModifier(StringRef Modifier) { LLVM_DEBUG(llvm::dbgs() << "parseModifier(" << Modifier << ")\n"); - bool IsNegated = Modifier.starts_with("no"); - St

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-05 Thread Alexandros Lamprineas via cfe-commits
@@ -166,6 +174,11 @@ void AArch64::ExtensionSet::enable(ArchExtKind E) { Touched.set(E); Enabled.set(E); + // These depend on each other, meaning you can't have one without the other. + // We don't want this to be in ExtensionDependencies to avoid infinite loops. + if (

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-05 Thread Alexandros Lamprineas via cfe-commits
@@ -69,8 +69,8 @@ void undefined(uint32x2_t v2i32, uint32x4_t v4i32, uint16x8_t v8i16, uint8x16_t vrnd_f16(v4f16); // expected-error {{always_inline function 'vrnd_f16' requires target feature 'fullfp16'}} vmaxnm_f16(v4f16, v4f16); // expected-error {{always_inline functio

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-04 Thread Tomas Matheson via cfe-commits
@@ -250,13 +248,17 @@ void AArch64::ExtensionSet::addArchDefaults(const ArchInfo &Arch) { bool AArch64::ExtensionSet::parseModifier(StringRef Modifier) { LLVM_DEBUG(llvm::dbgs() << "parseModifier(" << Modifier << ")\n"); - bool IsNegated = Modifier.starts_with("no"); - St

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-04 Thread Tomas Matheson via cfe-commits
@@ -265,6 +267,21 @@ bool AArch64::ExtensionSet::parseModifier(StringRef Modifier) { return false; } +void AArch64::ExtensionSet::reconstructFromParsedFeatures( +std::vector &Features) { tmatheson-arm wrote: ```suggestion const std::vector &Feature

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-04 Thread Tomas Matheson via cfe-commits
@@ -69,8 +69,8 @@ void undefined(uint32x2_t v2i32, uint32x4_t v4i32, uint16x8_t v8i16, uint8x16_t vrnd_f16(v4f16); // expected-error {{always_inline function 'vrnd_f16' requires target feature 'fullfp16'}} vmaxnm_f16(v4f16, v4f16); // expected-error {{always_inline functio

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-04 Thread Tomas Matheson via cfe-commits
@@ -106,7 +106,7 @@ def FeatureFPARMv8 : Extension<"fp-armv8", "FPARMv8", "Enable ARMv8 (FEAT_FP)", [], "FEAT_FP", "+fp-armv8,+neon", 90>; -let ArchExtKindSpelling = "AEK_SIMD", MArchName = "simd" in +let ArchExtKindSpelling = "AEK_SIMD", MArchName = "simd", MArchAlias = "

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-04 Thread Tomas Matheson via cfe-commits
@@ -166,6 +174,11 @@ void AArch64::ExtensionSet::enable(ArchExtKind E) { Touched.set(E); Enabled.set(E); + // These depend on each other, meaning you can't have one without the other. + // We don't want this to be in ExtensionDependencies to avoid infinite loops. + if (

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-04 Thread Tomas Matheson via cfe-commits
@@ -13663,17 +13664,18 @@ QualType ASTContext::getCorrespondingSignedFixedPointType(QualType Ty) const { } } -std::vector ASTContext::filterFunctionTargetVersionAttrs( -const TargetVersionAttr *TV) const { - assert(TV != nullptr); - llvm::SmallVector Feats; - std::ve

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-04 Thread Tomas Matheson via cfe-commits
@@ -250,13 +248,17 @@ void AArch64::ExtensionSet::addArchDefaults(const ArchInfo &Arch) { bool AArch64::ExtensionSet::parseModifier(StringRef Modifier) { LLVM_DEBUG(llvm::dbgs() << "parseModifier(" << Modifier << ")\n"); - bool IsNegated = Modifier.starts_with("no"); - St

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-04 Thread Alexandros Lamprineas via cfe-commits
@@ -69,8 +69,8 @@ void undefined(uint32x2_t v2i32, uint32x4_t v4i32, uint16x8_t v8i16, uint8x16_t vrnd_f16(v4f16); // expected-error {{always_inline function 'vrnd_f16' requires target feature 'fullfp16'}} vmaxnm_f16(v4f16, v4f16); // expected-error {{always_inline functio

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-04 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea edited https://github.com/llvm/llvm-project/pull/94279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-04 Thread Alexandros Lamprineas via cfe-commits
@@ -58,58 +58,57 @@ void v1msve() {} // CHECK-LABEL: @plussve() #12 __attribute__((target("+sve"))) void plussve() {} -// CHECK-LABEL: @plussveplussve2() #13 +// CHECK-LABEL: @plussveplussve2() #12 __attribute__((target("+sve+nosve2"))) void plussveplussve2() {} -// CHECK-LAB

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-04 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea edited https://github.com/llvm/llvm-project/pull/94279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-03 Thread Alexandros Lamprineas via cfe-commits
@@ -106,7 +106,7 @@ def FeatureFPARMv8 : Extension<"fp-armv8", "FPARMv8", "Enable ARMv8 (FEAT_FP)", [], "FEAT_FP", "+fp-armv8,+neon", 90>; -let ArchExtKindSpelling = "AEK_SIMD", MArchName = "simd" in +let ArchExtKindSpelling = "AEK_SIMD", MArchName = "simd", MArchAlias = "

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-03 Thread Alexandros Lamprineas via cfe-commits
@@ -579,6 +537,62 @@ inline constexpr CpuInfo CpuInfos[] = { AArch64::AEK_SSBS, AArch64::AEK_CSSC})}, }; +struct ExtensionSet { labrinea wrote: This has to move after the definition of `ArchInfo` because the method `toLLVMFeatu

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-03 Thread Alexandros Lamprineas via cfe-commits
@@ -27,7 +27,7 @@ int main(void) { (void)__builtin_cpu_supports("x86-64-v4"); (void)__builtin_cpu_supports("x86-64-v5"); // expected-warning {{invalid cpu feature string for builtin}} #else - if (__builtin_cpu_supports("neon")) // expected-warning {{invalid cpu feature s

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-03 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/94279 >From a413428bb0fdcd45b4a251e385b6cc00ff6a0a2c Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Mon, 3 Jun 2024 19:57:49 +0100 Subject: [PATCH] [AArch64] Decouple feature dependency expansion. The dep

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-03 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 875e91131847e3133d414c11c8ad721b52a287ee 2f15ae2082c996918f11076ef765914434dd615c --

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Alexandros Lamprineas (labrinea) Changes The dependency expansion step which was introduced by FMV has been erroneously used for non-FMV features, for example when parsing the target attribute. The PR #93695 has rectified most of the test

[clang] [llvm] [AArch64] Decouple feature dependency expansion. (PR #94279)

2024-06-03 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea created https://github.com/llvm/llvm-project/pull/94279 The dependency expansion step which was introduced by FMV has been erroneously used for non-FMV features, for example when parsing the target attribute. The PR #93695 has rectified most of the tests which were