Commit b17161ab by Antonio Maiorano

CMake: set REACTOR_DEFAULT_OPT_LEVEL to "" by default

Before this change, REACTOR_DEFAULT_OPT_LEVEL was set to "Default" by default, which would always define the REACTOR_DEFAULT_OPT_LEVEL macro to this value. Because of this, the Optimization constructor would forcibly set the Level member to this macro value. As a result, any value we would try to set for Optimization in code (e.g. via Optimization::Edit for a Routine generation) would be ignored. With this change, only if the user sets the REACTOR_DEFAULT_OPT_LEVEL CMake arg explicitly will it be used to override values in code. Bug: b/174031014 Change-Id: Ifd6c7fdc520d5b063f2a982d4d508b6eed593006 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/50709 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com>
parent e9fa209b
...@@ -163,7 +163,7 @@ set_property(CACHE SWIFTSHADER_LLVM_VERSION PROPERTY STRINGS "10.0") ...@@ -163,7 +163,7 @@ set_property(CACHE SWIFTSHADER_LLVM_VERSION PROPERTY STRINGS "10.0")
# If defined, overrides the default optimization level of the current reactor backend. # If defined, overrides the default optimization level of the current reactor backend.
# Set to one of the rr::Optimization::Level enum values. # Set to one of the rr::Optimization::Level enum values.
set(REACTOR_DEFAULT_OPT_LEVEL "Default" CACHE STRING "Reactor default optimization level") set(REACTOR_DEFAULT_OPT_LEVEL "" CACHE STRING "Reactor default optimization level")
set_property(CACHE REACTOR_DEFAULT_OPT_LEVEL PROPERTY STRINGS "None" "Less" "Default" "Aggressive") set_property(CACHE REACTOR_DEFAULT_OPT_LEVEL PROPERTY STRINGS "None" "Less" "Default" "Aggressive")
# Enable instrumentation of Reactor routines for MemorySanitizer builds (LLVM backend). # Enable instrumentation of Reactor routines for MemorySanitizer builds (LLVM backend).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment