diff options
author | Artem Serov <artem.serov@linaro.org> | 2019-07-31 18:28:00 +0100 |
---|---|---|
committer | Treehugger Robot <treehugger-gerrit@google.com> | 2020-04-17 10:35:45 +0000 |
commit | c8150b5def82058c23df377a5006a78e7668afeb (patch) | |
tree | 8f0e15b91cd55b978ca7f152206f0a550353810a /compiler/optimizing/loop_optimization_test.cc | |
parent | b2028739a2db03623ed76f5028ede1333c48f4c9 (diff) |
ART: Refactor SIMD slots and regs size processing.
ART vectorizer assumes that there is single size of SIMD
register used for the whole program. Make this assumption explicit
and refactor the code.
Note: This is a base for the future introduction of SIMD slots of
size other than 8 or 16 bytes.
Test: test-art-target, test-art-host.
Change-Id: Id699d5e3590ca8c655ecd9f9ed4e63f49e3c4f9c
Diffstat (limited to 'compiler/optimizing/loop_optimization_test.cc')
-rw-r--r-- | compiler/optimizing/loop_optimization_test.cc | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/compiler/optimizing/loop_optimization_test.cc b/compiler/optimizing/loop_optimization_test.cc index 310d98b5b0..8b4d58eaae 100644 --- a/compiler/optimizing/loop_optimization_test.cc +++ b/compiler/optimizing/loop_optimization_test.cc @@ -14,6 +14,7 @@ * limitations under the License. */ +#include "code_generator.h" #include "loop_optimization.h" #include "optimizing_unit_test.h" @@ -25,16 +26,29 @@ namespace art { * through the checker tests. */ class LoopOptimizationTest : public OptimizingUnitTest { - public: - LoopOptimizationTest() - : graph_(CreateGraph()), - iva_(new (GetAllocator()) HInductionVarAnalysis(graph_)), - loop_opt_(new (GetAllocator()) HLoopOptimization( - graph_, /* compiler_options= */ nullptr, iva_, /* stats= */ nullptr)) { + protected: + void SetUp() override { + OverrideInstructionSetFeatures(instruction_set_, "default"); + OptimizingUnitTest::SetUp(); + + graph_ = CreateGraph(); BuildGraph(); + iva_ = new (GetAllocator()) HInductionVarAnalysis(graph_); + DCHECK(compiler_options_ != nullptr); + codegen_ = CodeGenerator::Create(graph_, *compiler_options_); + DCHECK(codegen_.get() != nullptr); + loop_opt_ = new (GetAllocator()) HLoopOptimization( + graph_, *codegen_.get(), iva_, /* stats= */ nullptr); + } + + void TearDown() override { + codegen_.reset(); + graph_ = nullptr; + ResetPoolAndAllocator(); + OptimizingUnitTest::TearDown(); } - ~LoopOptimizationTest() { } + virtual ~LoopOptimizationTest() {} /** Constructs bare minimum graph. */ void BuildGraph() { @@ -102,6 +116,8 @@ class LoopOptimizationTest : public OptimizingUnitTest { // General building fields. HGraph* graph_; + + std::unique_ptr<CodeGenerator> codegen_; HInductionVarAnalysis* iva_; HLoopOptimization* loop_opt_; |