Commit b3fd2ea
authored
[Clang][FMV] Stop emitting implicit default version using target_clones. (llvm#141808)
With the current behavior the following example yields a linker error:
"multiple definition of `foo.default'"
// Translation Unit 1
__attribute__((target_clones("dotprod, sve"))) int foo(void) { return 1; }
// Translation Unit 2
int foo(void) { return 0; }
__attribute__((target_version("dotprod"))) int foo(void);
__attribute__((target_version("sve"))) int foo(void);
int bar(void) { return foo(); }
That is because foo.default is generated twice. As a user I don't find
this particularly intuitive. If I wanted the default to be generated in
TU1 I'd rather write target_clones("dotprod, sve", "default")
explicitly.
When changing the code I noticed that the RISC-V target defers the
resolver emission when encountering a target_version definition. This
seems accidental since it only makes sense for AArch64, where we only
emit a resolver once we've processed the entire TU, and only if the
default version is present. I've changed this so that RISC-V immediately
emmits the resolver. I adjusted the codegen tests since the functions
now appear in a different order.
Implements ARM-software/acle#3771 parent 68fd6f4 commit b3fd2ea
File tree
13 files changed
+1112
-1238
lines changed- clang
- lib
- CodeGen
- Sema
- test
- AST
- CodeGenCXX
- CodeGen
- AArch64
- Sema
13 files changed
+1112
-1238
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4237 | 4237 | | |
4238 | 4238 | | |
4239 | 4239 | | |
4240 | | - | |
4241 | | - | |
4242 | | - | |
| 4240 | + | |
4243 | 4241 | | |
4244 | | - | |
4245 | | - | |
4246 | 4242 | | |
4247 | 4243 | | |
4248 | 4244 | | |
4249 | | - | |
4250 | | - | |
4251 | | - | |
4252 | | - | |
| 4245 | + | |
| 4246 | + | |
| 4247 | + | |
| 4248 | + | |
| 4249 | + | |
| 4250 | + | |
| 4251 | + | |
| 4252 | + | |
4253 | 4253 | | |
4254 | 4254 | | |
4255 | 4255 | | |
| |||
4351 | 4351 | | |
4352 | 4352 | | |
4353 | 4353 | | |
4354 | | - | |
| 4354 | + | |
4355 | 4355 | | |
4356 | 4356 | | |
4357 | 4357 | | |
| |||
4374 | 4374 | | |
4375 | 4375 | | |
4376 | 4376 | | |
4377 | | - | |
4378 | | - | |
4379 | 4377 | | |
4380 | 4378 | | |
4381 | 4379 | | |
4382 | | - | |
| 4380 | + | |
| 4381 | + | |
4383 | 4382 | | |
4384 | 4383 | | |
4385 | 4384 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3495 | 3495 | | |
3496 | 3496 | | |
3497 | 3497 | | |
3498 | | - | |
3499 | | - | |
3500 | | - | |
3501 | | - | |
3502 | | - | |
3503 | | - | |
3504 | | - | |
| 3498 | + | |
3505 | 3499 | | |
3506 | 3500 | | |
3507 | 3501 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
71 | 79 | | |
72 | 80 | | |
73 | 81 | | |
| |||
76 | 84 | | |
77 | 85 | | |
78 | 86 | | |
| 87 | + | |
79 | 88 | | |
80 | 89 | | |
81 | 90 | | |
| |||
228 | 237 | | |
229 | 238 | | |
230 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
231 | 261 | | |
232 | 262 | | |
233 | 263 | | |
| |||
339 | 369 | | |
340 | 370 | | |
341 | 371 | | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
342 | 386 | | |
343 | 387 | | |
344 | 388 | | |
| |||
0 commit comments