Details
Diff Detail
Unit Tests
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 | ||
---|---|---|
3200–3201 | Will this change affect AArch64 or other targets expect AArch64 and x86? | |
clang/lib/Basic/Targets/X86.cpp | ||
120 | Why do we need to expand it again after we handling in driver? | |
121 | Please follow Lint's comment. | |
123–156 | Shouldn't this be simply skipped under "general-regs-only"? | |
clang/lib/Driver/ToolChains/Arch/X86.cpp | ||
222–223 | 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 | ||
---|---|---|
3200–3201 | No, using this option on other targets gives "argument unused during compilation" warning. | |
clang/lib/Basic/Targets/X86.cpp | ||
120 | The driver handles command line options, and this handles "target" attributes. (Note AArch64 only supports options) | |
123–156 | 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 | ||
222–223 | 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?