Meanwhile this patch added missing tests for supported CPU names
of cpu_dispatch/specific attribute and added more CHECKs for
resolver function.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
As mentioned in https://reviews.llvm.org/D151696, ping here, too. I want to land this patch first so that I could add some new Intel CPUs in this test supported in https://reviews.llvm.org/D151696
It came to me a better style:
ATTR(cpu_specific(generic)) void CPU1(void){} ATTR(cpu_specific(pentium_pro)) void CPU2(void){} ATTR(cpu_specific(pentium_mmx)) void CPU3(void){} ATTR(cpu_specific(pentium_ii)) void CPU4(void){} ATTR(cpu_specific(pentium_iii)) void CPU5(void){} ATTR(cpu_specific(pentium_iii_no_xmm_regs)) void CPU6(void){} ...
My purpose here is only to check if the cpu name string is valid for cpu_specific. So this also looks good, though it doesn't do the multiversion. I'll change into this style if no objections.
clang/test/CodeGen/attr-cpuspecific-cpus.c | ||
---|---|---|
2–3 | Yes, that's my purpose. Will do. | |
9 | Good catch. |
clang/test/CodeGen/attr-cpuspecific-cpus.c | ||
---|---|---|
13 | Shouldn't we use the same function name? |
clang/test/CodeGen/attr-cpuspecific-cpus.c | ||
---|---|---|
13 | Emmm... it would involve a new problem that some aliased cpu names would result a diagnostic like this: definition with same mangled name 'CPU.H' as another definition This is expected but my original purpose here is only to check if cpu name strings are valid. If you prefer, I can change into a style that makes the non-alias CPU names use the same function and makes the aliased ones' function names indexed. WDYT? |
clang/test/CodeGen/attr-cpuspecific-cpus.c | ||
---|---|---|
13 | That would make sense to me. |
Is it only to check no compile warning/error? Should we add a -verify?