From cced8ba4245a061ab047a0a6882468d75d619dd9 Mon Sep 17 00:00:00 2001 From: Artem Serov Date: Wed, 19 Jul 2017 18:18:09 +0100 Subject: ART: Introduce individual HInstruction cloning. Introduce API for HInstruction cloning, support it for a few instructions. add a gtest. Test: cloner_test.cc, test-art-target, test-art-host. Change-Id: I8b6299be5d04a26390d9ef13a20ce82ee5ae4afe --- compiler/optimizing/instruction_simplifier.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'compiler/optimizing/instruction_simplifier.cc') diff --git a/compiler/optimizing/instruction_simplifier.cc b/compiler/optimizing/instruction_simplifier.cc index 2bd2d5f0a1..7a1659e9d5 100644 --- a/compiler/optimizing/instruction_simplifier.cc +++ b/compiler/optimizing/instruction_simplifier.cc @@ -27,6 +27,10 @@ namespace art { +// Whether to run an exhaustive test of individual HInstructions cloning when each instruction +// is replaced with its copy if it is clonable. +static constexpr bool kTestInstructionClonerExhaustively = false; + class InstructionSimplifierVisitor : public HGraphDelegateVisitor { public: InstructionSimplifierVisitor(HGraph* graph, @@ -130,6 +134,11 @@ class InstructionSimplifierVisitor : public HGraphDelegateVisitor { }; void InstructionSimplifier::Run() { + if (kTestInstructionClonerExhaustively) { + CloneAndReplaceInstructionVisitor visitor(graph_); + visitor.VisitReversePostOrder(); + } + InstructionSimplifierVisitor visitor(graph_, codegen_, compiler_driver_, stats_); visitor.Run(); } -- cgit v1.2.3-59-g8ed1b