diff options
author | 2018-11-06 11:42:41 +0000 | |
---|---|---|
committer | 2019-01-30 14:09:25 +0000 | |
commit | 7f88c1a269754001bfcaf311b378cf1cc71acf84 (patch) | |
tree | 147bb988929e8bd8827c4b148f28da4c28c0ea70 /compiler/jit/jit_compiler.cc | |
parent | 5247113f3277fd679e3e1beeb6fbfb30797aa481 (diff) |
ART: Enable ISA features run-time detection for ARM64
On a target run-time detected ISA features can be more accurate than
instruction set features based on a build-time information such as an
instruction set variant or C++ defines. Build-time based features can
be too generic and do not include all features a target CPU supports.
This CL enables instruction feature run-time detection in the JIT/AOT
compilers:
- The value "runtime" to the option "--instruction-set-features" to try
to detect CPU features at run time. If a target does not support run-time
detection it has the same effect as the value "default".
- Runtime uses "--instruction-set-features=runtime" if run-time detection is
supported.
The CL also cleans up how an instruction set feature string is processed
by InstructionSetFeatures::AddFeaturesFromString. It used to make redundant
uses of Trim in subclasses. The calls are replaced with DCHECKs
verifying that feature names are already trimmed.
Test: m test-art-target-gtest
Test: m test-art-host-gtest
Test: art/test.py --target --optimizing --interpreter --jit
Test: art/test.py --host --optimizing --interpreter --jit
Test: Pixel 3 UI booted
Change-Id: I223d5bc968d589dba5c09f6b03ee8c25987610b0
Diffstat (limited to 'compiler/jit/jit_compiler.cc')
-rw-r--r-- | compiler/jit/jit_compiler.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/jit/jit_compiler.cc b/compiler/jit/jit_compiler.cc index 0d35fecb7b..4d7ae9bd1b 100644 --- a/compiler/jit/jit_compiler.cc +++ b/compiler/jit/jit_compiler.cc @@ -99,7 +99,10 @@ void JitCompiler::ParseCompilerOptions() { } } } + if (instruction_set_features == nullptr) { + // '--instruction-set-features/--instruction-set-variant' were not used. + // Use build-time defined features. instruction_set_features = InstructionSetFeatures::FromCppDefines(); } compiler_options_->instruction_set_features_ = std::move(instruction_set_features); |