summaryrefslogtreecommitdiff
path: root/compiler/common_compiler_test.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2020-05-13 09:21:00 +0100
committerVladimir Marko <vmarko@google.com>2020-05-15 14:09:54 +0000
commitf91fc1220f1b77c55317ff50f4dde8e6b043858f (patch)
tree3b8416a4fa9b9278d1114d4002485e0cb1c704bf /compiler/common_compiler_test.cc
parent33c091eaaa0febedc93cff820def75b122fde867 (diff)
Optimizing: Run gtests without creating the Runtime.
The only Optimizing test that actually needs a Runtime is the ReferenceTypePropagationTest, so we make it subclass CommonCompilerTest explicitly and change OptimizingUnitTest to subclass CommonArtTest for the other tests. On host, each test that initializes the Runtime takes ~220ms more than without initializing the Runtime. For example, the ConstantFoldingTest that has 10 individual tests previously took over 2.2s to run but without the Runtime initialization it takes around 3-5ms. On target, running 32-bit gtests on taimen with run-gtests.sh (single-threaded) goes from ~28m47s to ~26m13s, a reduction of ~9%. Test: m test-art-host-gtest Test: run-gtests.sh Change-Id: I43e50ed58e52cc0ad04cdb4d39801bfbae840a3d
Diffstat (limited to 'compiler/common_compiler_test.cc')
-rw-r--r--compiler/common_compiler_test.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc
index 18f00e21e4..6b4dbed03b 100644
--- a/compiler/common_compiler_test.cc
+++ b/compiler/common_compiler_test.cc
@@ -44,6 +44,17 @@
namespace art {
+std::unique_ptr<CompilerOptions> CommonCompilerTest::CreateCompilerOptions(
+ InstructionSet instruction_set, const std::string& variant) {
+ std::unique_ptr<CompilerOptions> compiler_options = std::make_unique<CompilerOptions>();
+ compiler_options->instruction_set_ = instruction_set;
+ std::string error_msg;
+ compiler_options->instruction_set_features_ =
+ InstructionSetFeatures::FromVariant(instruction_set, variant, &error_msg);
+ CHECK(compiler_options->instruction_set_features_ != nullptr) << error_msg;
+ return compiler_options;
+}
+
CommonCompilerTest::CommonCompilerTest() {}
CommonCompilerTest::~CommonCompilerTest() {}