Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I don't know much about target feature inheritance - does this guarantee that the entire sse/avx/avx512 level chain is correctly disabled?
clang/include/clang/Driver/Options.td | ||
---|---|---|
3210–3211 | Will this change affect AArch64 or other targets expect AArch64 and x86? | |
clang/lib/Basic/Targets/X86.cpp | ||
120–133 | Why do we need to expand it again after we handling in driver? | |
121 | Please follow Lint's comment. | |
136–158 | Shouldn't this be simply skipped under "general-regs-only"? | |
clang/lib/Driver/ToolChains/Arch/X86.cpp | ||
216–236 | Why we need copy the code here? Can it be simply use: if (Args.getLastArg(options::OPT_mgeneral_regs_only)) Features.insert(Features.end(), {"-x87", "-mmx", "-sse"}); handleTargetFeaturesGroup(Args, Features, options::OPT_m_x86_Features_Group); | |
clang/test/CodeGen/attr-target-general-regs-only-x86.c | ||
15 | Why we have a -avx512f when enabling avx2? | |
clang/test/Driver/x86-mgeneral-regs-only.c | ||
27 | ditto |
clang/include/clang/Driver/Options.td | ||
---|---|---|
3210–3211 | No, using this option on other targets gives "argument unused during compilation" warning. | |
clang/lib/Basic/Targets/X86.cpp | ||
120–133 | The driver handles command line options, and this handles "target" attributes. (Note AArch64 only supports options) | |
136–158 | It's still about order of options. Seeing a "general-regs-only" doesn't mean the function is really GPR only, we have to apply all options in order and check the result. | |
clang/lib/Driver/ToolChains/Arch/X86.cpp | ||
216–236 | To make sure later options override earlier ones. This is how GCC behaves. This is demonstrated in the "GPR" and "AVX2" check lines of the new tests. | |
clang/test/CodeGen/attr-target-general-regs-only-x86.c | ||
15 | See llvm::X86::updateImpliedFeatures(), enabling a feature will enable all features it depends on, disabling a feature also disables all features depending on it. This is "target feature inheritance" mentioned in Simon's comment. |
Will this change affect AArch64 or other targets expect AArch64 and x86?