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
diff --git a/compiler/optimizing/loop_optimization_test.cc b/compiler/optimizing/loop_optimization_test.cc
index 310d98b..8b4d58e 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 @@
* 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);
}
- ~LoopOptimizationTest() { }
+ void TearDown() override {
+ codegen_.reset();
+ graph_ = nullptr;
+ ResetPoolAndAllocator();
+ OptimizingUnitTest::TearDown();
+ }
+
+ virtual ~LoopOptimizationTest() {}
/** Constructs bare minimum graph. */
void BuildGraph() {
@@ -102,6 +116,8 @@
// General building fields.
HGraph* graph_;
+
+ std::unique_ptr<CodeGenerator> codegen_;
HInductionVarAnalysis* iva_;
HLoopOptimization* loop_opt_;