-
Notifications
You must be signed in to change notification settings - Fork 1.1k
cpu: rv64: cmake: fix gcc ice bug when specifying arch opt flags #4466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
If the user sets If the user does not provide compiler flags, we detect extension support via CMake; however, if the user explicitly specifies flags, we should compile using those specified flags. What do you think about this approach? |
Thank you for pointing this out @zhangfeiv0 . Updated in the new commit. Now we can:
See cmake logs:
I think a detection is still required even if the user specifies any custom flags. This PR addresses the issue where a user wants fewer extensions than the compiler's default capabilities by specifying |
Description
This PR fixes the gcc14.2 internal compiler error (ICE) bug that occurs when specifying
-DDNNL_ARCH_OPT_FLAGS="-march=rv64gcv"to disablezvfhextension.I attempted to disable
zvfhextension by adding-DDNNL_ARCH_OPT_FLAGS="-march=rv64gcv"in the cmake options. However, I found two bugs:platform.cmake, the test that setsDNNL_RISCV_USE_ZVFH_INTRINSICStotruepassed beforeDDNNL_ARCH_OPT_FLAGSoverried theCMAKE_CCXX_FLAGS.rvv_nhwc_pooling.hppusesDNNL_RISCV_USE_ZVFH_INTRINSICSflag for dispatch, but this flag can be undefined.These issues together cause a GCC ICE during compilation.
See Log
Bug Fix
We fix these bugs by:
DNNL_ARCH_OPT_FLAGSto correctly determine theCAN_COMPILE_ZVFH_INTRINSICSflag.zvfhruntime check by using thecpu_isa_traitsfor RV64.Tests
After this PR:
DNNL_RISCV_USE_ZVFH_INTRINSICSflag is set correctly and there are no compilation errors.See log
f16tests are skipped on therv64gcvplatform as excepted.See log