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
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
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
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
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
+ //
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
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
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
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
@@ -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 =
@@ -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 =
@@ -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 =
@@ -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 =
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
@@ -4120,6 +4127,9 @@ void CodeGenModule::emitMultiVersionFunctions() {
TA->getArchitecture(), Feats);
} else {
const auto *TVA = CurFD->getAttr();
+ if (TVA->isDefaultVersion() &&
+
@@ -4120,6 +4127,9 @@ void CodeGenModule::emitMultiVersionFunctions() {
TA->getArchitecture(), Feats);
} else {
const auto *TVA = CurFD->getAttr();
+ if (TVA->isDefaultVersion() &&
+
@@ -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 =
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 --
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
@@ -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
@@ -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 =
@@ -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 =
@@ -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
@@ -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 =
@@ -4120,6 +4127,9 @@ void CodeGenModule::emitMultiVersionFunctions() {
TA->getArchitecture(), Feats);
} else {
const auto *TVA = CurFD->getAttr();
+ if (TVA->isDefaultVersion() &&
+
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
@@ -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
@@ -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 =
@@ -4120,6 +4127,9 @@ void CodeGenModule::emitMultiVersionFunctions() {
TA->getArchitecture(), Feats);
} else {
const auto *TVA = CurFD->getAttr();
+ if (TVA->isDefaultVersion() &&
+
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);
+
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
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
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
@@ -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) {
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
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
@@ -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) {
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
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
39 matches
Mail list logo