Skip to content
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

Cleanup handling of march=native #1544

Merged
merged 1 commit into from
Aug 22, 2023
Merged

Cleanup handling of march=native #1544

merged 1 commit into from
Aug 22, 2023

Conversation

Dead2
Copy link
Member

@Dead2 Dead2 commented Jul 21, 2023

Simplify handling of native in CMake.

As a side note, ARM support in configure is quite messy. There is a lot of feature tests being defined directly in the final "Set arch specific flags" part (line ~1500+). All the other arches have their test functions defined well before that, and only have function calls in that part. Better readability and easier to reuse the test code.

@Dead2 Dead2 added cleanup Improving maintainability or removing code. Build Env labels Jul 21, 2023
@codecov
Copy link

codecov bot commented Jul 21, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.02% 🎉

Comparison is base (0cb2b37) 83.87% compared to head (4336b89) 83.90%.

❗ Current head 4336b89 differs from pull request most recent head f377948. Consider uploading reports for the commit f377948 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1544      +/-   ##
===========================================
+ Coverage    83.87%   83.90%   +0.02%     
===========================================
  Files          132      132              
  Lines        10843    10843              
  Branches      2801     2801              
===========================================
+ Hits          9095     9098       +3     
+ Misses        1049     1046       -3     
  Partials       699      699              
Flag Coverage Δ
macos_clang 42.97% <ø> (ø)
macos_gcc 73.61% <ø> (ø)
ubuntu_clang 83.53% <ø> (+1.02%) ⬆️
ubuntu_clang_debug 82.14% <ø> (ø)
ubuntu_clang_inflate_allow_invalid_dist 82.15% <ø> (ø)
ubuntu_clang_inflate_strict 82.49% <ø> (ø)
ubuntu_clang_mmap 82.82% <ø> (ø)
ubuntu_clang_pigz 13.96% <ø> (ø)
ubuntu_clang_pigz_no_optim 11.51% <ø> (ø)
ubuntu_clang_pigz_no_threads 13.78% <ø> (ø)
ubuntu_clang_reduced_mem 83.92% <ø> (+1.02%) ⬆️
ubuntu_clang_toolchain_riscv ∅ <ø> (∅)
ubuntu_gcc 75.30% <ø> (+0.07%) ⬆️
ubuntu_gcc_aarch64 77.40% <ø> (ø)
ubuntu_gcc_aarch64_compat_no_opt 75.65% <ø> (ø)
ubuntu_gcc_aarch64_no_acle 76.16% <ø> (ø)
ubuntu_gcc_aarch64_no_neon 76.16% <ø> (ø)
ubuntu_gcc_armhf 77.47% <ø> (ø)
ubuntu_gcc_armhf_compat_no_opt 75.62% <ø> (+0.01%) ⬆️
ubuntu_gcc_armhf_no_acle 77.42% <ø> (ø)
ubuntu_gcc_armhf_no_neon 77.32% <ø> (ø)
ubuntu_gcc_armsf 74.65% <ø> (ø)
ubuntu_gcc_armsf_compat_no_opt 74.11% <ø> (+0.01%) ⬆️
ubuntu_gcc_benchmark 73.82% <ø> (+0.41%) ⬆️
ubuntu_gcc_compat_no_opt 76.85% <ø> (+0.01%) ⬆️
ubuntu_gcc_compat_sprefix 73.73% <ø> (ø)
ubuntu_gcc_m32 73.23% <ø> (-0.16%) ⬇️
ubuntu_gcc_mingw_i686 73.50% <ø> (ø)
ubuntu_gcc_mingw_x86_64 73.51% <ø> (ø)
ubuntu_gcc_mips 74.97% <ø> (ø)
ubuntu_gcc_mips64 74.98% <ø> (ø)
ubuntu_gcc_no_avx2 74.28% <ø> (ø)
ubuntu_gcc_no_ctz 74.65% <ø> (ø)
ubuntu_gcc_no_ctzll 74.64% <ø> (ø)
ubuntu_gcc_no_pclmulqdq 74.28% <ø> (ø)
ubuntu_gcc_no_sse2 74.54% <ø> (ø)
ubuntu_gcc_no_sse42 74.73% <ø> (ø)
ubuntu_gcc_o1 74.18% <ø> (+0.05%) ⬆️
ubuntu_gcc_osb ∅ <ø> (∅)
ubuntu_gcc_pigz 38.17% <ø> (+0.02%) ⬆️
ubuntu_gcc_pigz_aarch64 39.02% <ø> (-0.03%) ⬇️
ubuntu_gcc_ppc 73.92% <ø> (ø)
ubuntu_gcc_ppc64 74.36% <ø> (ø)
ubuntu_gcc_ppc64_power9 74.53% <ø> (ø)
ubuntu_gcc_ppc64le 74.43% <ø> (ø)
ubuntu_gcc_ppc64le_novsx 74.75% <ø> (ø)
ubuntu_gcc_ppc64le_power9 74.31% <ø> (ø)
ubuntu_gcc_ppc_no_power8 74.63% <ø> (ø)
ubuntu_gcc_s390x 74.80% <ø> (ø)
ubuntu_gcc_s390x_dfltcc 71.92% <ø> (ø)
ubuntu_gcc_s390x_dfltcc_compat 73.98% <ø> (ø)
ubuntu_gcc_s390x_no_crc32 74.59% <ø> (ø)
ubuntu_gcc_sparc64 74.79% <ø> (ø)
ubuntu_gcc_sprefix 73.24% <ø> (ø)
win64_gcc 73.95% <ø> (-0.05%) ⬇️
win64_gcc_compat_no_opt 74.71% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@nmoinvaz nmoinvaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have questions whether check_neon_compiler_flag and check_acle_compiler_flag still need to be run if native. I can't really tell.. Otherwise looks gtm.

CMakeLists.txt Outdated Show resolved Hide resolved
@Dead2
Copy link
Member Author

Dead2 commented Aug 12, 2023

Rebased.

@Dead2
Copy link
Member Author

Dead2 commented Aug 12, 2023

I have questions whether check_neon_compiler_flag and check_acle_compiler_flag still need to be run if native. I can't really tell.. Otherwise looks gtm.

I think the correct thing to do is to rewrite those checks to instead use the native flag, and then verify that the neon/acle/etc code still compiles with native. And let that decide whether we attempt to include those optimized functions in the library or not.

Arm "native" was completely broken in configure before this PR, and with this it is less broken.
Before it would never compile any of the instruction set optimized functions.
With this PR it will enable all optimized functions that the compiler can support, not only the ones the cpu can support, different breakage is expected since much of the now-enabled code has never been tested like this before, only assumed to work.

I am tempted to just rip out the native support from configure completely, for all arches, rather than attempt to fix it and maintain it, and only support such advanced usage in CMake. It is a niche feature, and it is not trivial to get right with all the arch-specific code we have.

@nmoinvaz
Copy link
Member

Regarding my question, I don't really expect it to be resolved with this PR. It is just a strange scenario.

@Dead2
Copy link
Member Author

Dead2 commented Aug 20, 2023

Rebased and removed commit making changes to Configure. CMake changes remain unchanged.

CMakeLists.txt Outdated Show resolved Hide resolved
@Dead2 Dead2 merged commit aec18b6 into develop Aug 22, 2023
264 checks passed
@Dead2 Dead2 deleted the native-cleanup branch September 5, 2023 12:28
@Dead2 Dead2 mentioned this pull request Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Env cleanup Improving maintainability or removing code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants