summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_simplifier.cc
diff options
context:
space:
mode:
author Artem Serov <artem.serov@linaro.org> 2017-07-19 18:18:09 +0100
committer Artem Serov <artem.serov@linaro.org> 2017-11-07 12:56:17 +0000
commitcced8ba4245a061ab047a0a6882468d75d619dd9 (patch)
treeb379abfa48689c108e1cacedd2b13d4b5394baf2 /compiler/optimizing/instruction_simplifier.cc
parent96c76457d5c5af2d4243c78d74ada77de3223d88 (diff)
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
Diffstat (limited to 'compiler/optimizing/instruction_simplifier.cc')
-rw-r--r--compiler/optimizing/instruction_simplifier.cc9
1 files changed, 9 insertions, 0 deletions
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();
}