[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

[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 ) { +

[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.

[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.

[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.

[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 ) { bool AArch64::ExtensionSet::parseModifier(StringRef Modifier) { LLVM_DEBUG(llvm::dbgs() << "parseModifier(" << Modifier << ")\n"); - bool IsNegated = Modifier.starts_with("no"); -

[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

[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

[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() {} -//

[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

[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

[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

[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

[clang] [llvm] [AArch64] Remove SME/SVE uses of FMVDependencies (PR #93695)

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

[clang] [llvm] [AArch64] Remove SME/SVE uses of FMVDependencies (PR #93695)

2024-05-30 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea approved this pull request. I am also supporting this change. We have been trying to refactor attribute parsing for target/target_clones/target_version, as well as the target feature expansion which happens due to these attributes. It's a huge mess. Sorting such

[clang] [llvm] Split fmv and extensions (PR #92882)

2024-05-29 Thread Alexandros Lamprineas via cfe-commits
@@ -13754,11 +13750,14 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap , } Target->initFeatureMap(FeatureMap, getDiagnostics(), TargetCPU, Features); } else if (const auto *TV = FD->getAttr()) { -std::vector Feats =

[clang] [llvm] Split fmv and extensions (PR #92882)

2024-05-28 Thread Alexandros Lamprineas via cfe-commits
@@ -13754,11 +13760,14 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap , } Target->initFeatureMap(FeatureMap, getDiagnostics(), TargetCPU, Features); } else if (const auto *TV = FD->getAttr()) { -std::vector Feats =

[clang] [llvm] Split fmv and extensions (PR #92882)

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

[clang] [llvm] Split fmv and extensions (PR #92882)

2024-05-28 Thread Alexandros Lamprineas via cfe-commits
@@ -1062,35 +1064,41 @@ bool AArch64TargetInfo::initFeatureMap( llvm::AArch64::getExtensionFeatures(Exts, CPUFeats); labrinea wrote: I am wondering if calling ExtensionSet::addCPUDefaults here would be preferable. It's not NFC. I saw a test failing because

[clang] [llvm] Split fmv and extensions (PR #92882)

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

[clang] [llvm] Split fmv and extensions (PR #92882)

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

[clang] [llvm] Split fmv and extensions (PR #92882)

2024-05-28 Thread Alexandros Lamprineas via cfe-commits
@@ -13664,16 +13665,23 @@ QualType ASTContext::getCorrespondingSignedFixedPointType(QualType Ty) const { } } +// Given a list of FMV features, add each of their backend features to the list. +static void +GetFMVBackendFeaturesFor(const llvm::SmallVector FMVFeatStrings,

[clang] [clang][FMV] Allow declaration of function versions in namespaces. (PR #93044)

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

[clang] [clang][FMV] Allow declaration of function versions in namespaces. (PR #93044)

2024-05-23 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/93044 >From ba2b8b53d80e17b1477a7d6fed51f0450bc539a3 Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Wed, 22 May 2024 15:55:58 +0100 Subject: [PATCH] [clang][FMV] Allow declaration of function versions in

[clang] [clang][FMV] Allow declaration of function versions in namespaces. (PR #93044)

2024-05-23 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/93044 >From 730c8c5081862b330d66455a0495e9d317da1795 Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Wed, 22 May 2024 15:55:58 +0100 Subject: [PATCH] [clang][FMV] Allow declaration of function versions in

[clang] [clang][FMV] Allow declaration of function versions in namespaces. (PR #93044)

2024-05-23 Thread Alexandros Lamprineas via cfe-commits
@@ -11868,8 +11868,10 @@ static bool CheckMultiVersionFunction(Sema , FunctionDecl *NewFD, return false; if (!OldDecl || !OldDecl->getAsFunction() || - OldDecl->getDeclContext()->getRedeclContext() != - NewFD->getDeclContext()->getRedeclContext()) { +

[clang] [clang][FMV] Allow declaration of function versions in namespaces. (PR #93044)

2024-05-22 Thread Alexandros Lamprineas via cfe-commits
labrinea wrote: I found another bug for implicitly declared default versions not having the namespece mangling. Fixed now, please take another look. https://github.com/llvm/llvm-project/pull/93044 ___ cfe-commits mailing list

[clang] [clang][FMV] Allow declaration of function versions in namespaces. (PR #93044)

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

[clang] [clang][FMV] Allow declaration of function versions in namespaces. (PR #93044)

2024-05-22 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/93044 >From 1eb344d7a5e63c3e4e9e58f9141697d9d62b428c Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Wed, 22 May 2024 15:55:58 +0100 Subject: [PATCH] [clang][FMV] Allow declaration of function versions in

[clang] [clang][FMV] Allow declaration of function versions in namespaces. (PR #93044)

2024-05-22 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/93044 >From e1de85dc4b5fe09a8b6df2e10c16e58805e8873a Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Wed, 22 May 2024 15:55:58 +0100 Subject: [PATCH] [clang][FMV] Allow declaration of function versions in

[clang] [clang][FMV] Allow declaration of function versions in namespaces. (PR #93044)

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

[clang] [clang][FMV] Allow declaration of function versions in namespaces. (PR #93044)

2024-05-22 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea created https://github.com/llvm/llvm-project/pull/93044 Fixes a bug: ../llvm-project/clang/test/Sema/fmv-namespace.cpp:8:18: warning: attribute declaration must precede definition [-Wignored-attributes] 8 | int __attribute((target_version("sve"))) foo() {

[clang] [llvm] Split fmv and extensions (PR #92882)

2024-05-21 Thread Alexandros Lamprineas via cfe-commits
@@ -0,0 +1,84 @@ +// Function MultiVersioning (FMV) properties + +// Something you can add to target_version or target_clones +class FMVExtension { +// Name, as spelled in target_version or target_clones. e.g. "memtag" +string Name = n; + +// A C++ expression giving

[clang] [llvm] [AArch64] Merge duplicate extension information. (PR #92319)

2024-05-18 Thread Alexandros Lamprineas via cfe-commits
@@ -94,19 +94,21 @@ static void EmitARMTargetDef(RecordKeeper , raw_ostream ) { else OS << ", \"" << Alias << "\""; OS << ", AArch64::" << AEK; -if (AEK == "AEK_NONE") { +auto Name = Rec->getValueAsString("Name"); +if (Name.empty()) {

[clang] [llvm] [AArch64] Merge duplicate extension information. (PR #92319)

2024-05-18 Thread Alexandros Lamprineas via cfe-commits
@@ -56,43 +52,64 @@ class Extension< // The FMV priority int FMVPriority = _FMVPriority; + +// Indicates if the extension is available on the command line. +string IsFMVOnly = _IsFMVOnly; labrinea wrote: We want the ExtensionInfo field to be

[clang] [llvm] [AArch64] Merge duplicate extension information. (PR #92319)

2024-05-18 Thread Alexandros Lamprineas via cfe-commits
@@ -56,43 +52,64 @@ class Extension< // The FMV priority int FMVPriority = _FMVPriority; + +// Indicates if the extension is available on the command line. +string IsFMVOnly = _IsFMVOnly; } // Some extensions are available for FMV but can not be controlled

[clang] [llvm] [AArch64] Merge duplicate extension information. (PR #92319)

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

[clang] [llvm] [AArch64] Merge duplicate extension information. (PR #92319)

2024-05-17 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/92319 >From 0c00fc2537f9b6335aa35535ffaf09c57051f086 Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Tue, 14 May 2024 17:46:00 +0100 Subject: [PATCH] [AArch64] Merge duplicate extension information. When

[clang] [compiler-rt] [llvm] Reland "[FMV] Remove useless features according the latest ACLE spec." (PR #89232)

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

[clang] [llvm] [FMV] Rectify incomplete ExtensionInfo entries in TargetParser. (PR #89106)

2024-04-17 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea created https://github.com/llvm/llvm-project/pull/89106 This patch is sorting out inconsistencies in TargetParser regarding: * features without corresponding ArchExtKind * features without (Neg)Feature string * features with incorrect DependentFeatures string Also

[clang] [compiler-rt] [llvm] [FMV] Remove useless features according the latest ACLE spec. (PR #88965)

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

[clang] [compiler-rt] [llvm] [FMV] Remove useless features according the latest ACLE spec. (PR #88965)

2024-04-17 Thread Alexandros Lamprineas via cfe-commits
@@ -67,57 +67,42 @@ enum CPUFeatures { FEAT_FP, FEAT_SIMD, FEAT_CRC, - FEAT_SHA1, FEAT_SHA2, FEAT_SHA3, FEAT_AES, - FEAT_PMULL, FEAT_FP16, - FEAT_DIT, FEAT_DPB, FEAT_DPB2, FEAT_JSCVT, FEAT_FCMA, FEAT_RCPC, FEAT_RCPC2, FEAT_FRINTTS, -

[clang] [compiler-rt] [llvm] [FMV] Remove useless features according the latest ACLE spec. (PR #88965)

2024-04-16 Thread Alexandros Lamprineas via cfe-commits
labrinea wrote: > Mind listing which ones are affected in the commit summary? Done https://github.com/llvm/llvm-project/pull/88965 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [FMV] Remove useless features according the latest ACLE spec. (PR #88965)

2024-04-16 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/88965 >From 22dffaef7a1f8e3cd8efdbf51536e38986d622ea Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Tue, 16 Apr 2024 19:42:07 +0100 Subject: [PATCH] [FMV] Remove useless features according the latest ACLE

[clang] [compiler-rt] [llvm] [FMV] Remove useless features according the latest ACLE spec. (PR #88965)

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

[clang] [compiler-rt] [llvm] [FMV] Remove useless features according the latest ACLE spec. (PR #88965)

2024-04-16 Thread Alexandros Lamprineas via cfe-commits
labrinea wrote: In a follow up patch I will be sorting out inconsistencies in TargetParser regarding: * features without corresponding ArchExtKind * features without (Neg)Feature string * features with incorrect DependentFeatures string https://github.com/llvm/llvm-project/pull/88965

[clang] [compiler-rt] [llvm] [FMV] Remove useless features according the latest ACLE spec. (PR #88965)

2024-04-16 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea created https://github.com/llvm/llvm-project/pull/88965 As explained in https://github.com/ARM-software/acle/pull/315 we are deprecating features which aren't adding any value. >From 9c2dc3240d79e4a05015bcc60a300e94971ae983 Mon Sep 17 00:00:00 2001 From: Alexandros

[clang] [clang][FMV] Pass the '+fmv' target-feature when FMV is enabled. (PR #87942)

2024-04-07 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea created https://github.com/llvm/llvm-project/pull/87942 This will allow the backend to enable the corresponding subtarget feature (FeatureFMV), which in turn can be queried for llvm codegen decisions. See #87939 for example. >From

[clang] [clang][FMV] Direct-call FMV callees from FMV callers (PR #80093)

2024-03-31 Thread Alexandros Lamprineas via cfe-commits
labrinea wrote: @erichkeane while I agree that Clang might not be the best place for such an optimization, I have some concerns about implementing it in LLVM: * We cannot distinguish a FMV resolver from any other ifunc resolver. * There is no information at the LLVM IR level about function

[clang] [FMV] Allow mixing target_version with target_clones. (PR #86493)

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

[clang] [FMV] Allow mixing target_version with target_clones. (PR #86493)

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

[clang] [FMV] Allow mixing target_version with target_clones. (PR #86493)

2024-03-25 Thread Alexandros Lamprineas via cfe-commits
@@ -0,0 +1,278 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals --include-generated-funcs +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature -v9.5a -S -emit-llvm

[clang] [FMV] Allow mixing target_version with target_clones. (PR #86493)

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

[clang] [FMV] Allow mixing target_version with target_clones. (PR #86493)

2024-03-25 Thread Alexandros Lamprineas via cfe-commits
@@ -0,0 +1,278 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals --include-generated-funcs +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature -v9.5a -S -emit-llvm

[clang] [FMV] Allow mixing target_version with target_clones. (PR #86493)

2024-03-25 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/86493 >From dfef9d04c0a65423a051ac00044b39f8911aa731 Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Fri, 22 Mar 2024 17:21:13 + Subject: [PATCH] [FMV] Allow mixing target_version with target_clones.

[clang] [FMV] Allow mixing target_version with target_clones. (PR #86493)

2024-03-25 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea created https://github.com/llvm/llvm-project/pull/86493 The latest ACLE allows it and further clarifies the following in regards to the combination of the two attributes: "If the `default` matches with another explicitly provided version in the same translation

[clang] [FMV] Allow multi versioning without default declaration. (PR #85454)

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

[clang] [FMV] Allow multi versioning without default declaration. (PR #85454)

2024-03-23 Thread Alexandros Lamprineas via cfe-commits
@@ -109,9 +109,22 @@ int unused_with_implicit_default_def(void) { return 1; } int unused_with_implicit_forward_default_def(void) { return 0; } __attribute__((target_version("lse"))) int unused_with_implicit_forward_default_def(void) { return 1; } -// This should generate a

[clang] [FMV] Allow multi versioning without default declaration. (PR #85454)

2024-03-23 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/85454 >From 289d36fd371f9f47e2ceb3a682e3c6d122341f3b Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Fri, 15 Mar 2024 19:25:16 + Subject: [PATCH] [FMV] Allow multi versioning without default

[clang] [FMV] Allow multi versioning without default declaration. (PR #85454)

2024-03-22 Thread Alexandros Lamprineas via cfe-commits
@@ -109,9 +109,22 @@ int unused_with_implicit_default_def(void) { return 1; } int unused_with_implicit_forward_default_def(void) { return 0; } __attribute__((target_version("lse"))) int unused_with_implicit_forward_default_def(void) { return 1; } -// This should generate a

[clang] [FMV] Allow multi versioning without default declaration. (PR #85454)

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

[clang] [FMV] Allow multi versioning without default declaration. (PR #85454)

2024-03-22 Thread Alexandros Lamprineas via cfe-commits
@@ -68,13 +68,15 @@ int __attribute__((target_version(""))) unsup1(void) { return 1; } void __attribute__((target_version("crc32"))) unsup2(void) {} void __attribute__((target_version("default+fp16"))) koo(void) {} +//expected-error@-1 {{function multiversioning doesn't

[clang] [FMV] Allow multi versioning without default declaration. (PR #85454)

2024-03-22 Thread Alexandros Lamprineas via cfe-commits
@@ -109,9 +109,22 @@ int unused_with_implicit_default_def(void) { return 1; } int unused_with_implicit_forward_default_def(void) { return 0; } __attribute__((target_version("lse"))) int unused_with_implicit_forward_default_def(void) { return 1; } -// This should generate a

[clang] [FMV] Allow multi versioning without default declaration. (PR #85454)

2024-03-22 Thread Alexandros Lamprineas via cfe-commits
@@ -483,14 +483,16 @@ void just_fine(void) {} __arm_locally_streaming __attribute__((target_version("sme2"))) -void just_fine_locally_streaming(void) {} +void incompatible_locally_streaming(void) {} +// expected-error@-1 {{attribute 'target_version' multiversioning cannot be

[clang] [FMV] Allow multi versioning without default declaration. (PR #85454)

2024-03-22 Thread Alexandros Lamprineas via cfe-commits
@@ -70,17 +69,23 @@ int __attribute__((target_version("lse"))) extc(void) { return 1; } auto __attribute__((target_version("default"))) ret1(void) { return 1; } auto __attribute__((target_version("dpb"))) ret2(void) { return 1; } +// expected-error@-1 {{attribute

[clang] [FMV] Allow multi versioning without default declaration. (PR #85454)

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

[clang] [FMV] Allow fmv without default declaration. (PR #85454)

2024-03-22 Thread Alexandros Lamprineas via cfe-commits
labrinea wrote: Update: The ACLE spec is now explicit about this (see https://github.com/ARM-software/acle/pull/310), so we can safely implement the change in the compiler. Implementation-wise I have moved the static cast to `llvm::Function` inside the `createFunction()` lambda.

[clang] [FMV] Allow fmv without default declaration. (PR #85454)

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

[clang] [FMV] Allow fmv without default declaration. (PR #85454)

2024-03-22 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/85454 >From 60a6fcd7560ec434a8369240f7a9cd13cf035c42 Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Fri, 15 Mar 2024 19:25:16 + Subject: [PATCH] [FMV] Allow multi versioning without default

[clang] Reland [FMV] Emit the resolver along with the default version definit… (PR #85923)

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

[clang] Reland [FMV] Emit the resolver along with the default version definit… (PR #85923)

2024-03-20 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/85923 >From c0c07deebef4e2c76d935b4ce8fc1d4abddab4db Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Wed, 20 Mar 2024 10:32:58 + Subject: [PATCH] Reland [FMV] Emit the resolver along with the default

[clang] Reland [FMV] Emit the resolver along with the default version definit… (PR #85923)

2024-03-20 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea created https://github.com/llvm/llvm-project/pull/85923 …ion. This was reverted because the resolver didn't look as expected in one of the tests. I believe it had some interaction with #84146. I have now regenerated it using -target-feature -fp-armv8. >From

[clang] Revert "[FMV] Emit the resolver along with the default version definition." (PR #85914)

2024-03-20 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea created https://github.com/llvm/llvm-project/pull/85914 Reverts llvm/llvm-project#84405 In between of passing the precommit tests on github and being merged some change (perhaps in the AArch64 backend?) landed which resulted in altering the generated resolver. I

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

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

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

2024-03-19 Thread Alexandros Lamprineas via cfe-commits
labrinea wrote: I have raised two related pull requests stacked on this one: - https://github.com/labrinea/llvm-project/pull/1 - https://github.com/labrinea/llvm-project/pull/2 Is there anything else we would like to address in this patch? https://github.com/llvm/llvm-project/pull/84405

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

2024-03-17 Thread Alexandros Lamprineas via cfe-commits
labrinea wrote: Ah, I see. That is addressed in #85454 but I have already expressed a concern. https://github.com/llvm/llvm-project/pull/84405 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

2024-03-17 Thread Alexandros Lamprineas via cfe-commits
labrinea wrote: > In the current patch, it just gets the non-mangled name. And the fact that we > get a not-mangled function that uses `feature` without going through a > resolver is concerning to me. I am not sure I understand. Are you refering to the StringSet I added which keeps

[clang] [FMV] Allow fmv without default declaration. (PR #85454)

2024-03-17 Thread Alexandros Lamprineas via cfe-commits
labrinea wrote: Hmm, I am now having second thoughts about this change. All is well without a default declaration as long as we don't have a caller in the TU. In that case (if there is a caller) a resolver is needed, but without a default declaration we can't create a complete resolver (the

[clang] [FMV] Allow fmv without default declaration. (PR #85454)

2024-03-15 Thread Alexandros Lamprineas via cfe-commits
labrinea wrote: I think I messed up the review, this is based on #84405 so it shows unrelated changes. Ignore for now. I'll rebase https://github.com/llvm/llvm-project/pull/85454 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [FMV] Allow fmv without default declaration. (PR #85454)

2024-03-15 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea created https://github.com/llvm/llvm-project/pull/85454 This was a limitation which has now been lifted upon request. Please read the thread below for more details: https://github.com/llvm/llvm-project/pull/84405#discussion_r1525583647 Basically it allows

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

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

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

2024-03-15 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/84405 >From 6a495010024b93bb8871eebe6e10c62d1f5d2fc5 Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Thu, 7 Mar 2024 22:25:13 + Subject: [PATCH] [FMV] Emit the resolver along with the default version

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

2024-03-15 Thread Alexandros Lamprineas via cfe-commits
@@ -4347,6 +4362,19 @@ void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) { } } +/// Adds a declaration to the list of multi version functions if not present. +void CodeGenModule::AddDeferredMultiVersionResolverToEmit(GlobalDecl GD) { + const auto *FD =

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

2024-03-15 Thread Alexandros Lamprineas via cfe-commits
@@ -4347,6 +4362,19 @@ void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) { } } +/// Adds a declaration to the list of multi version functions if not present. +void CodeGenModule::AddDeferredMultiVersionResolverToEmit(GlobalDecl GD) { + const auto *FD =

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

2024-03-15 Thread Alexandros Lamprineas via cfe-commits
@@ -4347,6 +4362,19 @@ void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) { } } +/// Adds a declaration to the list of multi version functions if not present. +void CodeGenModule::AddDeferredMultiVersionResolverToEmit(GlobalDecl GD) { + const auto *FD =

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

2024-03-15 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/84405 >From 2576857fe4b5c0b99c1a29c07f92c80498687665 Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Thu, 7 Mar 2024 22:25:13 + Subject: [PATCH] [FMV] Emit the resolver along with the default version

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

2024-03-15 Thread Alexandros Lamprineas via cfe-commits
@@ -84,9 +84,33 @@ int hoo(void) { return fp1() + fp2(); } +// This should generate one target version but no resolver. +__attribute__((target_version("default"))) int unused_with_forward_default_decl(void); +__attribute__((target_version("mops"))) int

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

2024-03-15 Thread Alexandros Lamprineas via cfe-commits
@@ -4347,6 +4362,19 @@ void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) { } } +/// Adds a declaration to the list of multi version functions if not present. +void CodeGenModule::AddDeferredMultiVersionResolverToEmit(GlobalDecl GD) { + const auto *FD =

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

2024-03-15 Thread Alexandros Lamprineas via cfe-commits
@@ -4347,6 +4362,19 @@ void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) { } } +/// Adds a declaration to the list of multi version functions if not present. +void CodeGenModule::AddDeferredMultiVersionResolverToEmit(GlobalDecl GD) { + const auto *FD =

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

2024-03-15 Thread Alexandros Lamprineas via cfe-commits
@@ -84,9 +84,33 @@ int hoo(void) { return fp1() + fp2(); } +// This should generate one target version but no resolver. +__attribute__((target_version("default"))) int unused_with_forward_default_decl(void); +__attribute__((target_version("mops"))) int

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

2024-03-15 Thread Alexandros Lamprineas via cfe-commits
@@ -4347,6 +4362,19 @@ void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) { } } +/// Adds a declaration to the list of multi version functions if not present. +void CodeGenModule::AddDeferredMultiVersionResolverToEmit(GlobalDecl GD) { + const auto *FD =

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

2024-03-15 Thread Alexandros Lamprineas via cfe-commits
@@ -4120,6 +4127,9 @@ void CodeGenModule::emitMultiVersionFunctions() { TA->getArchitecture(), Feats); } else { const auto *TVA = CurFD->getAttr(); + if (TVA->isDefaultVersion() && +

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

2024-03-14 Thread Alexandros Lamprineas via cfe-commits
labrinea wrote: The key takeaway from my conversation with @DanielKristofKiss was that it is important for Function Multi Versioning to work even when the default target attribute is omitted. It was quite a headache to get this working in clang, but the latest revision supports the desired

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

2024-03-14 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/84405 >From bde335c2b4a85ee5e7f57ff9081c38b4dd9839ca Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Thu, 7 Mar 2024 22:25:13 + Subject: [PATCH] [FMV] Emit the resolver along with the default version

[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

2024-03-07 Thread Alexandros Lamprineas via cfe-commits
@@ -85,7 +85,21 @@ int hoo(void) { } +// This should generate one target version but no resolver. +__attribute__((target_version("default"))) int unused_with_forward_default_decl(void); +__attribute__((target_version("mops"))) int unused_with_forward_default_decl(void) {

  1   2   3   >