From 4b822fb73104868c250cbb4c39e01d43675e7095 Mon Sep 17 00:00:00 2001 From: Phil Ramsey Date: Mon, 16 Oct 2023 13:02:58 +0000 Subject: [PATCH 1/8] i#5365: Build AArch64 unit tests with SVE enabled Add BUILD_TESTS_SVE build option to compile with SVE flags and high optimisation (-O3). Add some error checking to allow the -O3 build and consequently update a template (expected output) file. Issue: #5365 --- CMakeLists.txt | 4 ++++ suite/tests/CMakeLists.txt | 18 ++++++++++++++++++ suite/tests/client-interface/drx-test.c | 4 +++- suite/tests/linux/eintr.c | 3 ++- suite/tests/linux/tool.drcov.eintr.template | 11 ++++++----- 5 files changed, 33 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c1bb8ea09bc..4d0309ed755 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1612,6 +1612,10 @@ if (BUILD_TESTS) include(CTest) endif (BUILD_TESTS) +if (AARCH64) + option(BUILD_TESTS_SVE "Build tests with SVE enabled and high optimization (-O3)" OFF) +endif (AARCH64) + if (BUILD_CORE) add_subdirectory(core) endif (BUILD_CORE) diff --git a/suite/tests/CMakeLists.txt b/suite/tests/CMakeLists.txt index 8d894e8c6a2..286edffb9ab 100644 --- a/suite/tests/CMakeLists.txt +++ b/suite/tests/CMakeLists.txt @@ -553,6 +553,24 @@ function(add_exe test source) "${CMAKE_GENERATOR}" MATCHES "Visual Studio") add_dependencies(${test} ${gen_asm_tgt}) endif () + if (BUILD_TESTS_SVE) + target_compile_options(${test} PRIVATE + "-march=armv8.4-a+crypto+rcpc+sha3+sm4+sve+rng+ssbs+nodotprod") + + # Some tests give very obscure build errors when built with "-O3" + # FIXME i#5365: fix build issues due to optimisation, unless no + # optimisation is a requirement for a test case. + if ( + NOT ${test} STREQUAL "api.rseq" AND + NOT ${test} STREQUAL "linux.rseq" AND + NOT ${test} STREQUAL "linux.rseq_table" AND + NOT ${test} STREQUAL "linux.rseq_noarray" AND + NOT ${test} STREQUAL "linux.clone" AND + NOT ${test} STREQUAL "linux.clone-pie" + ) + target_compile_options(${test} PRIVATE "-O3") + endif() + endif(BUILD_TESTS_SVE) endfunction(add_exe) # normal app diff --git a/suite/tests/client-interface/drx-test.c b/suite/tests/client-interface/drx-test.c index 56a79e6e070..4c4d391f982 100644 --- a/suite/tests/client-interface/drx-test.c +++ b/suite/tests/client-interface/drx-test.c @@ -241,7 +241,9 @@ main(int argc, char **argv) /* child */ int iter = 0; close(pipefd[0]); /* close unused read end */ - write(pipefd[1], &buf, sizeof(buf)); + if (write(pipefd[1], &buf, sizeof(buf)) == -1) { + perror("write to pipe failed\n"); + } close(pipefd[1]); /* spin until parent kills us or we time out */ while (iter++ < 12) { diff --git a/suite/tests/linux/eintr.c b/suite/tests/linux/eintr.c index d27e7798973..1f2196d8978 100644 --- a/suite/tests/linux/eintr.c +++ b/suite/tests/linux/eintr.c @@ -127,7 +127,8 @@ main(int argc, char **argv) child_ready = false; pthread_mutex_unlock(&lock); - write(pipefd[1], "ab", 2); + if (write(pipefd[1], "ab", 2) == -1) + perror("Failed to write to pipe\n"); if (pthread_join(thread, &retval) != 0) perror("failed to join thread"); diff --git a/suite/tests/linux/tool.drcov.eintr.template b/suite/tests/linux/tool.drcov.eintr.template index ccb79bd51a5..784935b207c 100644 --- a/suite/tests/linux/tool.drcov.eintr.template +++ b/suite/tests/linux/tool.drcov.eintr.template @@ -44,12 +44,13 @@ DA:126,1 DA:127,1 DA:128,1 DA:130,1 -DA:132,1 -DA:133,0 -DA:135,1 +DA:131,0 +DA:133,1 +DA:134,0 DA:136,1 -DA:138,1 +DA:137,1 DA:139,1 -DA:141,1 +DA:140,1 DA:142,1 +DA:143,1 end_of_record From 9098fb8d5ec6bd60df9bff1ea233a9a147960112 Mon Sep 17 00:00:00 2001 From: Phil Ramsey Date: Wed, 18 Oct 2023 08:46:31 +0000 Subject: [PATCH 2/8] i#5365: Build AArch64 unit tests with SVE enabled Add BUILD_TESTS_SVE build option to compile with SVE flags and high optimisation (-O3). Add some error checking to allow the -O3 build and consequently update a template (expected output) file. Issue: #5365 --- CMakeLists.txt | 1 + suite/tests/CMakeLists.txt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d0309ed755..41420c44111 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1612,6 +1612,7 @@ if (BUILD_TESTS) include(CTest) endif (BUILD_TESTS) +# TODO i#5365: auto set this using CHECK_C_COMPILER_FLAG once any new test failures have been investigated if (AARCH64) option(BUILD_TESTS_SVE "Build tests with SVE enabled and high optimization (-O3)" OFF) endif (AARCH64) diff --git a/suite/tests/CMakeLists.txt b/suite/tests/CMakeLists.txt index 286edffb9ab..347c84354ba 100644 --- a/suite/tests/CMakeLists.txt +++ b/suite/tests/CMakeLists.txt @@ -553,6 +553,8 @@ function(add_exe test source) "${CMAKE_GENERATOR}" MATCHES "Visual Studio") add_dependencies(${test} ${gen_asm_tgt}) endif () + + # TODO i#5365: auto set this using CHECK_C_COMPILER_FLAG once any new test failures have been investigated if (BUILD_TESTS_SVE) target_compile_options(${test} PRIVATE "-march=armv8.4-a+crypto+rcpc+sha3+sm4+sve+rng+ssbs+nodotprod") From b325ec961d2b256d8eb334a119b0967b786df820 Mon Sep 17 00:00:00 2001 From: Phil Ramsey Date: Mon, 6 Nov 2023 15:21:12 +0000 Subject: [PATCH 3/8] i#5365: Build core unit tests with SVE enabled Build most core tests with SVE flags and high optimisation (-O3), if building on a AARCH64 SVE machine. Tests which fail when built with -O3 are not included. Add some error checking to a few tests to allow the -O3 build and update template (expected output) files as necessary. --- CMakeLists.txt | 5 --- suite/tests/CMakeLists.txt | 65 +++++++++++++++++++++++++++----------- 2 files changed, 46 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41420c44111..c1bb8ea09bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1612,11 +1612,6 @@ if (BUILD_TESTS) include(CTest) endif (BUILD_TESTS) -# TODO i#5365: auto set this using CHECK_C_COMPILER_FLAG once any new test failures have been investigated -if (AARCH64) - option(BUILD_TESTS_SVE "Build tests with SVE enabled and high optimization (-O3)" OFF) -endif (AARCH64) - if (BUILD_CORE) add_subdirectory(core) endif (BUILD_CORE) diff --git a/suite/tests/CMakeLists.txt b/suite/tests/CMakeLists.txt index 347c84354ba..ada39aa6273 100644 --- a/suite/tests/CMakeLists.txt +++ b/suite/tests/CMakeLists.txt @@ -474,6 +474,49 @@ function(append_link_flags target newflags) LINK_FLAGS "${cur_ldflags} ${newflags}") endfunction(append_link_flags) +set( sve_tests + simple_app api.ir api.ir_negative api.ir_v81 api.ir_v82 api.ir_v83 api.ir_v84 api.ir_v86 + api.ir_sve api.ir_sve2 api.ir-static api.drdecode common.broadfun common.fib common.nzcv + common.getretaddr common.segfault common.allasm_aarch64_isa common.allasm_aarch64_cache + allasm_aarch64_prefetch allasm_aarch64_flush libutil.frontend_test libutil.drconfig_test + client.call-retarget client.modules client.annotation-concurrency client.partial_module_map + client.execfault client.events client.events_cpp client.timer client.mangle_suspend + client.syscall-mod client.signal client.cleancallsig client.file_io client.cleancall-opt-1 + client.inline client.null_instrument client.large_options client.stolen-reg-index + client.gonative client.drmgr-test client.drx_buf-test client.drbbdup-drwrap-test + client.drbbdup-emul-test client.process-id client.drreg-test client.low_on_memory client.tls + client.drx-scattergather client.drwrap-test client.drwrap-drreg-test drstatecmp-fuzz-app + client.drutil-test client.stolen-reg client.ldstex api.dis-a64 api.reenc-a64 api.opnd + api.detach api.detach_state api.detach_signal api.detach_spawn api.detach_spawn_stress_FLAKY + api.detach_spawn_quick_exit api.ibl-stress api.ibl-stress-aarch64-far-link_LONG + api.static_startstop api.static_noclient api.static_noinit api.static_detach + api.static_prepop api.static_reattach_client_flags api.static_crash api.static_sideline_FLAKY + api.static_symbols api.static_maps_mixup_yesvars api.static_maps_mixup_novars_FLAKY + api.thread_churn client.app_args client.destructor builtin_prefetch tool.multiproc + stride_benchmark tool.fib_plus tool.heap_test tool.drcacheoff.gencode linux.eintr + linux.execve-sub linux.execve-null linux.execve-config linux.execv linux.execve-rec + linux.exit linux.fork linux.fork-sleep linux.infinite linux.longjmp linux.prctl linux.mmap + linux.zero-length-mem-ranges linux.sigaction linux.syscall_pwait linux.sigaction_nosignals + linux.thread linux.threadexit linux.threadexit2 linux.signalfd linux.alarm + linux.signal_racesys linux.signal_pre_syscall linux.bad-signal-stack linux.sigsuspend + linux.sigmask linux.mangle_asynch linux.app_tls linux.readlink + linux.fib-conflict linux.fib-static linux.fib-pie linux.vfork pthreads.pthreads + pthreads.pthreads_exit pthreads.ptsig pthreads.pthreads_fork_FLAKY security-linux.trampoline + linux.infloop linux.rseq_disable security-common.codemod security-common.ret_noncall_trace + security-common.retnonexisting security-common.TestAllocWE + security-common.TestMemProtChg_FLAKY client.drx-test + ) + +function(add_sve_flags target) + if (proc_supports_sve) + if (target IN_LIST sve_tests) + target_compile_options(${target} PRIVATE + -march=armv8.4-a+crypto+rcpc+sha3+sm4+sve+rng+ssbs+nodotprod + -O3) + endif() + endif() +endfunction(add_sve_flags) + function(add_exe test source) get_filename_component(srcbase ${source} NAME_WE) get_filename_component(srcpath ${source} PATH) @@ -554,25 +597,9 @@ function(add_exe test source) add_dependencies(${test} ${gen_asm_tgt}) endif () - # TODO i#5365: auto set this using CHECK_C_COMPILER_FLAG once any new test failures have been investigated - if (BUILD_TESTS_SVE) - target_compile_options(${test} PRIVATE - "-march=armv8.4-a+crypto+rcpc+sha3+sm4+sve+rng+ssbs+nodotprod") - - # Some tests give very obscure build errors when built with "-O3" - # FIXME i#5365: fix build issues due to optimisation, unless no - # optimisation is a requirement for a test case. - if ( - NOT ${test} STREQUAL "api.rseq" AND - NOT ${test} STREQUAL "linux.rseq" AND - NOT ${test} STREQUAL "linux.rseq_table" AND - NOT ${test} STREQUAL "linux.rseq_noarray" AND - NOT ${test} STREQUAL "linux.clone" AND - NOT ${test} STREQUAL "linux.clone-pie" - ) - target_compile_options(${test} PRIVATE "-O3") - endif() - endif(BUILD_TESTS_SVE) + if (AARCH64) + add_sve_flags(${test}) + endif(AARCH64) endfunction(add_exe) # normal app From cbe7fd0c35243f4aa72ff76b15eac96c6884d5bd Mon Sep 17 00:00:00 2001 From: Phil Ramsey Date: Wed, 8 Nov 2023 17:47:39 +0000 Subject: [PATCH 4/8] i#5365: Build core unit tests with SVE enabled Build most core tests with SVE flags and high optimisation (-O3), if building on a AARCH64 SVE machine. Tests which fail when built with -O3 are not included. Add some error checking to a few tests to allow the -O3 build and update template (expected output) files as necessary. Issue: #5365 --- suite/tests/CMakeLists.txt | 94 +++++++++++++++++++++++++------------- 1 file changed, 61 insertions(+), 33 deletions(-) diff --git a/suite/tests/CMakeLists.txt b/suite/tests/CMakeLists.txt index ada39aa6273..c4da5a13064 100644 --- a/suite/tests/CMakeLists.txt +++ b/suite/tests/CMakeLists.txt @@ -279,6 +279,9 @@ if (UNIX) string(REGEX REPLACE "-Wall" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") # some tests rely on specific "nop;nop" patterns that optimization ruins # we should probably move the -O from top level into core/CMakeLists.txt + # + # -O3 is selectively re-added to some tests using the add_sve_flags() or + # optimize() functions string(REGEX REPLACE "-O[0-9]? " " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") else (UNIX) # W2 is default (we're using W3). We should also replace @@ -474,35 +477,53 @@ function(append_link_flags target newflags) LINK_FLAGS "${cur_ldflags} ${newflags}") endfunction(append_link_flags) -set( sve_tests - simple_app api.ir api.ir_negative api.ir_v81 api.ir_v82 api.ir_v83 api.ir_v84 api.ir_v86 - api.ir_sve api.ir_sve2 api.ir-static api.drdecode common.broadfun common.fib common.nzcv - common.getretaddr common.segfault common.allasm_aarch64_isa common.allasm_aarch64_cache - allasm_aarch64_prefetch allasm_aarch64_flush libutil.frontend_test libutil.drconfig_test - client.call-retarget client.modules client.annotation-concurrency client.partial_module_map - client.execfault client.events client.events_cpp client.timer client.mangle_suspend - client.syscall-mod client.signal client.cleancallsig client.file_io client.cleancall-opt-1 - client.inline client.null_instrument client.large_options client.stolen-reg-index - client.gonative client.drmgr-test client.drx_buf-test client.drbbdup-drwrap-test - client.drbbdup-emul-test client.process-id client.drreg-test client.low_on_memory client.tls - client.drx-scattergather client.drwrap-test client.drwrap-drreg-test drstatecmp-fuzz-app - client.drutil-test client.stolen-reg client.ldstex api.dis-a64 api.reenc-a64 api.opnd - api.detach api.detach_state api.detach_signal api.detach_spawn api.detach_spawn_stress_FLAKY - api.detach_spawn_quick_exit api.ibl-stress api.ibl-stress-aarch64-far-link_LONG - api.static_startstop api.static_noclient api.static_noinit api.static_detach - api.static_prepop api.static_reattach_client_flags api.static_crash api.static_sideline_FLAKY - api.static_symbols api.static_maps_mixup_yesvars api.static_maps_mixup_novars_FLAKY - api.thread_churn client.app_args client.destructor builtin_prefetch tool.multiproc - stride_benchmark tool.fib_plus tool.heap_test tool.drcacheoff.gencode linux.eintr - linux.execve-sub linux.execve-null linux.execve-config linux.execv linux.execve-rec - linux.exit linux.fork linux.fork-sleep linux.infinite linux.longjmp linux.prctl linux.mmap - linux.zero-length-mem-ranges linux.sigaction linux.syscall_pwait linux.sigaction_nosignals - linux.thread linux.threadexit linux.threadexit2 linux.signalfd linux.alarm - linux.signal_racesys linux.signal_pre_syscall linux.bad-signal-stack linux.sigsuspend - linux.sigmask linux.mangle_asynch linux.app_tls linux.readlink - linux.fib-conflict linux.fib-static linux.fib-pie linux.vfork pthreads.pthreads - pthreads.pthreads_exit pthreads.ptsig pthreads.pthreads_fork_FLAKY security-linux.trampoline - linux.infloop linux.rseq_disable security-common.codemod security-common.ret_noncall_trace +# It would be nice to get rid of the +# string(REGEX REPLACE "-O[0-9]? " " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") +# line above and instead selectively remove -O3 from tests that cannot +# support it. +# This was investigated and proved to be non trivial as the client tests +# use _DR_set_compile_flags() to set the compile flags whereas the core +# tests use set_cflags(). _DR_set_compile_flags() is a public function and we +# didn't want to add a blocklist in there. +# For now we create a list of tests that can be built with -O3. +# This is for AARCH64 UNIX only. +# TODO change this allowlist to a blocklist +set(sve_tests + simple_app api.ir api.ir_negative api.ir_v81 api.ir_v82 api.ir_v83 api.ir_v84 + api.ir_v86 api.ir_sve api.ir_sve2 api.ir-static api.drdecode common.broadfun + common.fib common.nzcv common.getretaddr common.segfault + common.allasm_aarch64_isa common.allasm_aarch64_cache allasm_aarch64_prefetch + allasm_aarch64_flush libutil.frontend_test libutil.drconfig_test + client.call-retarget client.modules client.annotation-concurrency + client.partial_module_map client.execfault client.events client.events_cpp + client.timer client.mangle_suspend client.syscall-mod client.signal + client.cleancallsig client.file_io client.cleancall-opt-1 client.inline + client.null_instrument client.large_options client.stolen-reg-index + client.gonative client.drmgr-test client.drx_buf-test + client.drbbdup-drwrap-test client.drbbdup-emul-test client.process-id + client.drreg-test client.low_on_memory client.tls client.drx-scattergather + client.drwrap-test client.drwrap-drreg-test drstatecmp-fuzz-app + client.drutil-test client.stolen-reg client.ldstex api.dis-a64 api.reenc-a64 + api.opnd api.detach api.detach_state api.detach_signal api.detach_spawn + api.detach_spawn_stress_FLAKY api.detach_spawn_quick_exit api.ibl-stress + api.ibl-stress-aarch64-far-link_LONG api.static_startstop api.static_noclient + api.static_noinit api.static_detach api.static_prepop + api.static_reattach_client_flags api.static_crash api.static_sideline_FLAKY + api.static_symbols api.static_maps_mixup_yesvars + api.static_maps_mixup_novars_FLAKY api.thread_churn client.app_args + client.destructor builtin_prefetch tool.multiproc stride_benchmark + tool.fib_plus tool.heap_test tool.drcacheoff.gencode linux.eintr + linux.execve-sub linux.execve-null linux.execve-config linux.execv + linux.execve-rec linux.exit linux.fork linux.fork-sleep linux.infinite + linux.longjmp linux.prctl linux.mmap linux.zero-length-mem-ranges + linux.sigaction linux.syscall_pwait linux.sigaction_nosignals linux.thread + linux.threadexit linux.threadexit2 linux.signalfd linux.alarm + linux.signal_racesys linux.signal_pre_syscall linux.bad-signal-stack + linux.sigsuspend linux.sigmask linux.mangle_asynch linux.app_tls + linux.readlink linux.fib-conflict linux.fib-static linux.fib-pie linux.vfork + pthreads.pthreads pthreads.pthreads_exit pthreads.ptsig + pthreads.pthreads_fork_FLAKY security-linux.trampoline linux.infloop + linux.rseq_disable security-common.codemod security-common.ret_noncall_trace security-common.retnonexisting security-common.TestAllocWE security-common.TestMemProtChg_FLAKY client.drx-test ) @@ -512,6 +533,9 @@ function(add_sve_flags target) if (target IN_LIST sve_tests) target_compile_options(${target} PRIVATE -march=armv8.4-a+crypto+rcpc+sha3+sm4+sve+rng+ssbs+nodotprod + # reinstate the -03 flag which is removed with the + # string(REGEX REPLACE "-O[0-9]? " " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + # line above -O3) endif() endif() @@ -597,9 +621,9 @@ function(add_exe test source) add_dependencies(${test} ${gen_asm_tgt}) endif () - if (AARCH64) - add_sve_flags(${test}) - endif(AARCH64) + # AARCH64 AND UNIX only + add_sve_flags(${test}) + endfunction(add_exe) # normal app @@ -1746,7 +1770,11 @@ function(use_MD_not_MTd source_file) endif () endfunction() -# optimize the target +# the -O3 flag is removed above with the +# string(REGEX REPLACE "-O[0-9]? " " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") +# line. -O3 is then selectively readded with this function or add_sve_flags(). +# It will be desirable to one day remove the "REGEX REPLACE" line and just +# remove -O3 for targets that cannot support it. function(optimize target) if (UNIX) append_property_string(TARGET ${target} COMPILE_FLAGS "-O3") From 6c920cdf6d1a37edabc16ec0eda2ece0dda16f95 Mon Sep 17 00:00:00 2001 From: Phil Ramsey Date: Thu, 9 Nov 2023 12:45:35 +0000 Subject: [PATCH 5/8] i#5365: Build core unit tests with SVE enabled Build most core tests with SVE flags and high optimisation (-O3), if building on an AARCH64 SVE machine. Tests which fail when built with -O3 are not included. Add some error checking to a few tests to allow the -O3 build and update template (expected output) files as necessary. Issue #6429 raised to cover making the removal of optimization flags more granular. Issue: #5365 --- suite/tests/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/suite/tests/CMakeLists.txt b/suite/tests/CMakeLists.txt index 94928953358..1bb975e9790 100644 --- a/suite/tests/CMakeLists.txt +++ b/suite/tests/CMakeLists.txt @@ -482,12 +482,12 @@ endfunction(append_link_flags) # line above and instead selectively remove -O3 from tests that cannot # support it. # This was investigated and proved to be non trivial as the client tests -# use _DR_set_compile_flags() to set the compile flags whereas the core +# use _DR_set_compile_flags() to set the compile flags whereas the core # tests use set_cflags(). _DR_set_compile_flags() is a public function and we # didn't want to add a blocklist in there. # For now we create a list of tests that can be built with -O3. # This is for AARCH64 UNIX only. -# TODO change this allowlist to a blocklist +# TODO i#6429 Optimization flags are removed for all tests. set(sve_tests simple_app api.ir api.ir_negative api.ir_v81 api.ir_v82 api.ir_v83 api.ir_v84 api.ir_v86 api.ir_sve api.ir_sve2 api.ir-static api.drdecode common.broadfun @@ -533,9 +533,9 @@ function(add_sve_flags target) if (target IN_LIST sve_tests) target_compile_options(${target} PRIVATE -march=armv8.4-a+crypto+rcpc+sha3+sm4+sve+rng+ssbs+nodotprod - # reinstate the -03 flag which is removed with the + # Reinstate the -03 flag which is removed with the # string(REGEX REPLACE "-O[0-9]? " " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - # line above + # line above. -O3) endif() endif() @@ -1770,9 +1770,9 @@ function(use_MD_not_MTd source_file) endif () endfunction() -# the -O3 flag is removed above with the +# The -O3 flag is removed above with the # string(REGEX REPLACE "-O[0-9]? " " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") -# line. -O3 is then selectively readded with this function or add_sve_flags(). +# line. -O3 is then selectively re-added with this function or add_sve_flags(). # It will be desirable to one day remove the "REGEX REPLACE" line and just # remove -O3 for targets that cannot support it. function(optimize target) From 7945d470fb97ca6cf7fb103eead801d039715754 Mon Sep 17 00:00:00 2001 From: Phil Ramsey Date: Thu, 9 Nov 2023 12:58:39 +0000 Subject: [PATCH 6/8] i#5365: Build core unit tests with SVE enabled Build most core tests with SVE flags and high optimisation (-O3), if building on an AARCH64 SVE machine. Tests which fail when built with -O3 are not included. Add some error checking to a few tests to allow the -O3 build and update template (expected output) files as necessary. Issue #6429 raised to cover making the removal of optimization flags more granular. Issue: #5365 --- suite/tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suite/tests/CMakeLists.txt b/suite/tests/CMakeLists.txt index 1bb975e9790..d5f97bfc95b 100644 --- a/suite/tests/CMakeLists.txt +++ b/suite/tests/CMakeLists.txt @@ -533,7 +533,7 @@ function(add_sve_flags target) if (target IN_LIST sve_tests) target_compile_options(${target} PRIVATE -march=armv8.4-a+crypto+rcpc+sha3+sm4+sve+rng+ssbs+nodotprod - # Reinstate the -03 flag which is removed with the + # Reinstate the -03 flag which is removed with the # string(REGEX REPLACE "-O[0-9]? " " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") # line above. -O3) From 8bdc9b5b00b1f990cfa59cdb178df83e06e9d8a9 Mon Sep 17 00:00:00 2001 From: Phil Ramsey Date: Thu, 9 Nov 2023 13:12:24 +0000 Subject: [PATCH 7/8] i#5365: Build core unit tests with SVE enabled Build most core tests with SVE flags and high optimisation (-O3), if building on an AARCH64 SVE machine. Tests which fail when built with -O3 are not included. Add some error checking to a few tests to allow the -O3 build and update template (expected output) files as necessary. Issue #6429 raised to cover making the removal of optimization flags more granular. Issue: #5365 --- suite/tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suite/tests/CMakeLists.txt b/suite/tests/CMakeLists.txt index d5f97bfc95b..5111b1799d6 100644 --- a/suite/tests/CMakeLists.txt +++ b/suite/tests/CMakeLists.txt @@ -1770,7 +1770,7 @@ function(use_MD_not_MTd source_file) endif () endfunction() -# The -O3 flag is removed above with the +# The -O3 flag is removed above with the # string(REGEX REPLACE "-O[0-9]? " " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") # line. -O3 is then selectively re-added with this function or add_sve_flags(). # It will be desirable to one day remove the "REGEX REPLACE" line and just From e1b9fe3ff8593fbf5b2a0b7b4796ea17810d71ce Mon Sep 17 00:00:00 2001 From: Phil Ramsey Date: Fri, 10 Nov 2023 10:21:26 +0000 Subject: [PATCH 8/8] i#5365: Build core unit tests with SVE enabled Build most core tests with SVE flags and high optimisation (-O3), if building on an AARCH64 SVE machine. Tests which fail when built with -O3 are not included. Add some error checking to a few tests to allow the -O3 build and update template (expected output) files as necessary. Issue #6429 raised to cover making the removal of optimization flags more granular. Issue: #5365 --- suite/tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suite/tests/CMakeLists.txt b/suite/tests/CMakeLists.txt index 5111b1799d6..45bd5bf0d6c 100644 --- a/suite/tests/CMakeLists.txt +++ b/suite/tests/CMakeLists.txt @@ -487,7 +487,7 @@ endfunction(append_link_flags) # didn't want to add a blocklist in there. # For now we create a list of tests that can be built with -O3. # This is for AARCH64 UNIX only. -# TODO i#6429 Optimization flags are removed for all tests. +# TODO i#6429 Change this allowlist to a blocklist. set(sve_tests simple_app api.ir api.ir_negative api.ir_v81 api.ir_v82 api.ir_v83 api.ir_v84 api.ir_v86 api.ir_sve api.ir_sve2 api.ir-static api.drdecode common.broadfun