[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 Jon Roelofs via cfe-commits
https://github.com/jroelofs approved this pull request. All three LGTM. 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 Jon Roelofs via cfe-commits
jroelofs wrote: I'm referring to: ``` // This should generate a normal function. int __attribute__((target_version("rdm"))) unused_without_default(void); ``` and: ``` // CHECK: Function Attrs: noinline nounwind optnone + // CHECK-LABEL: define {{[^@]+}}@unused_without_default + //

[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] Emit the resolver along with the default version definition. (PR #84405)

2024-03-17 Thread Jon Roelofs via cfe-commits
jroelofs wrote: The current patch looks mostly good, but I'm still hung up on this: > I'd like to support FMV in existing codebases as lean as possible, so the > default version attribute would be optional to write as not all > version/toolchain will support it. smallest possible codebase

[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 Jon Roelofs 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 Jon Roelofs via cfe-commits
https://github.com/jroelofs 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 Jon Roelofs 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-15 Thread Jon Roelofs 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-15 Thread Jon Roelofs 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 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 8c4546f350fbce938d8fbc85d9e353d011f3f673 2576857fe4b5c0b99c1a29c07f92c80498687665 --

[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 Jon Roelofs via cfe-commits
https://github.com/jroelofs 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-14 Thread Jon Roelofs 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-14 Thread Jon Roelofs 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-14 Thread Jon Roelofs 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 Daniel Kiss via cfe-commits
DanielKristofKiss wrote: I'd like to support FMV in existing codebases as lean as possible, so the default version attribute would be optional to write as not all version/toolchain will support it. smallest possible codebase change to introduce multi versioning: ```c int foo(void); +

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

2024-03-14 Thread Jon Roelofs via cfe-commits
jroelofs wrote: Can you elaborate on that conversation a bit more? I want to make sure we cover all the corner cases. 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-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-08 Thread Jon Roelofs 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) {

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

2024-03-08 Thread Jon Roelofs via cfe-commits
https://github.com/jroelofs 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-08 Thread Jon Roelofs via cfe-commits
https://github.com/jroelofs approved this pull request. 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-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) {

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

2024-03-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Alexandros Lamprineas (labrinea) Changes We would like the resolver to be generated eagerly, even if the versioned function is not called from the current translation unit. Fixes #81494. --- Patch is 42.97 KiB, truncated to

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

2024-03-07 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea created https://github.com/llvm/llvm-project/pull/84405 We would like the resolver to be generated eagerly, even if the versioned function is not called from the current translation unit. Fixes #81494. >From d2572439a8e130c03febd60366962c96b5b4501d Mon Sep 17