Change to enable VPU flag for VE by default in order to support vector
intrinsics from clang.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Looks good.
The default should be able to use intrinsics, hiding this only makes things complicated and gets users confused.
I randamly added reviewrs who review code related to feature flags and features group in clang. I appreciate if some of you guys have a time to check this patch too. Thank you so much.
clang/include/clang/Driver/Options.td | ||
---|---|---|
5851 | Other feature group options don't set CC1Option: we do not need them as CC1 options (e.g. -Xclang -msse4) |
clang/include/clang/Driver/Options.td | ||
---|---|---|
5854 | In general, we just need documentation for the non-default option (let's say -mvevpu). Documentation for the opposite -mno-mvevpu is just boilerplate and not very useful. | |
clang/test/Driver/ve-features.c | ||
2 | -target has been deprecated since Clang 3.4. Use --target= |
Hi @MaskRay , thank you for reviewing this patch last time. Is it possible to review updated this patch again? Thanks!
clang/lib/Driver/ToolChains/Arch/VE.cpp | ||
---|---|---|
22 | Delete the comment. The code speaks itself. if (Args.hasArg(options::OPT_mvevpu, options::OPT_mno_vevpu, true) Features.push_back("+vpu"); | |
clang/test/Driver/ve-features.c | ||
2 | I think we typically spend just two RUN lines:
The additional coverage for having 3 RUN lines is probably not useful. |
[VE][Clang] Change to enable VPU flag by default
For components like llvm/, clang/, we usually use a more specific tag. I'd pick [Driver] over [Clang].
Change to not control backend default bahavior but support VPU flag in
the backend for VE.
clang/lib/Driver/ToolChains/Arch/VE.cpp | ||
---|---|---|
22 | Thanks. I remove comments and simplify existing code. | |
clang/test/Driver/ve-features.c | ||
2 | Thank you for suggesting. I consider what this patch should do and change the purpose to support VPU flag in the backend for VE. As a result, Tests are two RUN lines.
|
I also change it to following.
[Driver][VE] Support VPU flag as a feature for VE
Thank you so much.
clang/lib/Driver/ToolChains/Arch/VE.cpp | ||
---|---|---|
22 | Sorry for my typo. We should use the 3-argument hasFlag here. It's simpler than getLastArg+matches |
clang/lib/Driver/ToolChains/Arch/VE.cpp | ||
---|---|---|
22 | I see. I was wondering that part too. Now, I change it to use hasFlag function with default value. | |
clang/test/Driver/ve-features.c | ||
2 | Because we use hasFlag with default value, test is changed again for following two RUN lines.
|
Other feature group options don't set CC1Option: we do not need them as CC1 options (e.g. -Xclang -msse4)