Skip to content

Commit

Permalink
i#5365: Build core unit tests with SVE enabled
Browse files Browse the repository at this point in the history
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
  • Loading branch information
philramsey-arm committed Nov 9, 2023
1 parent 9c5dba0 commit 6c920cd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions suite/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 6c920cd

Please sign in to comment.