Revert "Add stats support for existing optimizations"
Breaks the build. Please ensure your changes build.
This reverts commit 06241b1b07fb031b7d2cf55f4b78d3444d07cc2d.
Change-Id: I68b18f99a9882719bf6654d3313531a7965b8483
diff --git a/compiler/optimizing/boolean_simplifier.cc b/compiler/optimizing/boolean_simplifier.cc
index c3e88f3..f985745 100644
--- a/compiler/optimizing/boolean_simplifier.cc
+++ b/compiler/optimizing/boolean_simplifier.cc
@@ -36,8 +36,6 @@
if (!boolean_not->HasUses()) {
boolean_not->GetBlock()->RemoveInstruction(boolean_not);
}
-
- MaybeRecordStat(MethodCompilationStat::kBooleanSimplifier);
}
// Returns true if 'block1' and 'block2' are empty, merge into the same single
@@ -148,8 +146,6 @@
block->MergeWith(false_block);
block->MergeWith(merge_block);
- MaybeRecordStat(MethodCompilationStat::kBooleanSimplifier);
-
// No need to update any dominance information, as we are simplifying
// a simple diamond shape, where the join block is merged with the
// entry block. Any following blocks would have had the join block
diff --git a/compiler/optimizing/boolean_simplifier.h b/compiler/optimizing/boolean_simplifier.h
index 0eb6c71..e12a12c 100644
--- a/compiler/optimizing/boolean_simplifier.h
+++ b/compiler/optimizing/boolean_simplifier.h
@@ -62,8 +62,8 @@
class HBooleanSimplifier : public HOptimization {
public:
- HBooleanSimplifier(HGraph* graph, OptimizingCompilerStats* stats)
- : HOptimization(graph, kBooleanSimplifierPassName, stats) {}
+ explicit HBooleanSimplifier(HGraph* graph)
+ : HOptimization(graph, kBooleanSimplifierPassName) {}
void Run() OVERRIDE;
diff --git a/compiler/optimizing/constant_folding.cc b/compiler/optimizing/constant_folding.cc
index 1db775e..57452cc 100644
--- a/compiler/optimizing/constant_folding.cc
+++ b/compiler/optimizing/constant_folding.cc
@@ -68,7 +68,6 @@
} else {
inst->Accept(&simplifier);
}
- MaybeRecordStat(MethodCompilationStat::kConstantFolding);
} else if (inst->IsUnaryOperation()) {
// Constant folding: replace `op(a)' with a constant at compile
// time if `a' is a constant.
@@ -77,7 +76,6 @@
inst->ReplaceWith(constant);
inst->GetBlock()->RemoveInstruction(inst);
}
- MaybeRecordStat(MethodCompilationStat::kConstantFolding);
} else if (inst->IsTypeConversion()) {
// Constant folding: replace `TypeConversion(a)' with a constant at
// compile time if `a' is a constant.
@@ -86,7 +84,6 @@
inst->ReplaceWith(constant);
inst->GetBlock()->RemoveInstruction(inst);
}
- MaybeRecordStat(MethodCompilationStat::kConstantFolding);
} else if (inst->IsDivZeroCheck()) {
// We can safely remove the check if the input is a non-null constant.
HDivZeroCheck* check = inst->AsDivZeroCheck();
@@ -95,7 +92,6 @@
check->ReplaceWith(check_input);
check->GetBlock()->RemoveInstruction(check);
}
- MaybeRecordStat(MethodCompilationStat::kConstantFolding);
}
}
}
diff --git a/compiler/optimizing/constant_folding.h b/compiler/optimizing/constant_folding.h
index df89371..2698b2d 100644
--- a/compiler/optimizing/constant_folding.h
+++ b/compiler/optimizing/constant_folding.h
@@ -32,10 +32,8 @@
*/
class HConstantFolding : public HOptimization {
public:
- HConstantFolding(HGraph* graph,
- OptimizingCompilerStats* stats,
- const char* name = kConstantFoldingPassName)
- : HOptimization(graph, name, stats) {}
+ explicit HConstantFolding(HGraph* graph, const char* name = kConstantFoldingPassName)
+ : HOptimization(graph, name) {}
void Run() OVERRIDE;
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index b33f6f2..0363f20 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -395,11 +395,11 @@
// Run simple optimizations on the graph.
HDeadCodeElimination dce(callee_graph, stats_);
- HConstantFolding fold(callee_graph, stats_);
+ HConstantFolding fold(callee_graph);
ReferenceTypePropagation type_propagation(callee_graph, handles_);
HSharpening sharpening(callee_graph, codegen_, dex_compilation_unit, compiler_driver_);
InstructionSimplifier simplify(callee_graph, stats_);
- IntrinsicsRecognizer intrinsics(callee_graph, compiler_driver_, stats_);
+ IntrinsicsRecognizer intrinsics(callee_graph, compiler_driver_);
HOptimization* optimizations[] = {
&intrinsics,
diff --git a/compiler/optimizing/intrinsics.cc b/compiler/optimizing/intrinsics.cc
index 9516f01..b01324e 100644
--- a/compiler/optimizing/intrinsics.cc
+++ b/compiler/optimizing/intrinsics.cc
@@ -438,7 +438,6 @@
<< invoke->DebugName();
} else {
invoke->SetIntrinsic(intrinsic, NeedsEnvironmentOrCache(intrinsic));
- MaybeRecordStat(MethodCompilationStat::kIntrinsicsRecognizer);
}
}
}
diff --git a/compiler/optimizing/intrinsics.h b/compiler/optimizing/intrinsics.h
index cc4f708..e459516 100644
--- a/compiler/optimizing/intrinsics.h
+++ b/compiler/optimizing/intrinsics.h
@@ -30,8 +30,8 @@
// Recognize intrinsics from HInvoke nodes.
class IntrinsicsRecognizer : public HOptimization {
public:
- IntrinsicsRecognizer(HGraph* graph, CompilerDriver* driver, OptimizingCompilerStats* stats)
- : HOptimization(graph, kIntrinsicsRecognizerPassName, stats),
+ IntrinsicsRecognizer(HGraph* graph, CompilerDriver* driver)
+ : HOptimization(graph, kIntrinsicsRecognizerPassName),
driver_(driver) {}
void Run() OVERRIDE;
diff --git a/compiler/optimizing/licm.cc b/compiler/optimizing/licm.cc
index 6d0a616..c38bbe3 100644
--- a/compiler/optimizing/licm.cc
+++ b/compiler/optimizing/licm.cc
@@ -123,7 +123,6 @@
UpdateLoopPhisIn(instruction->GetEnvironment(), loop_info);
}
instruction->MoveBefore(pre_header->GetLastInstruction());
- MaybeRecordStat(MethodCompilationStat::kLICM);
} else if (instruction->CanThrow()) {
// If `instruction` can throw, we cannot move further instructions
// that can throw as well.
diff --git a/compiler/optimizing/licm.h b/compiler/optimizing/licm.h
index bf56f53..0b5a0f1 100644
--- a/compiler/optimizing/licm.h
+++ b/compiler/optimizing/licm.h
@@ -26,9 +26,8 @@
class LICM : public HOptimization {
public:
- LICM(HGraph* graph, const SideEffectsAnalysis& side_effects, OptimizingCompilerStats* stats)
- : HOptimization(graph, kLoopInvariantCodeMotionPassName, stats),
- side_effects_(side_effects) {}
+ LICM(HGraph* graph, const SideEffectsAnalysis& side_effects)
+ : HOptimization(graph, kLoopInvariantCodeMotionPassName), side_effects_(side_effects) {}
void Run() OVERRIDE;
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 24f0d77..2204921 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -487,10 +487,10 @@
graph, stats, HDeadCodeElimination::kInitialDeadCodeEliminationPassName);
HDeadCodeElimination* dce2 = new (arena) HDeadCodeElimination(
graph, stats, HDeadCodeElimination::kFinalDeadCodeEliminationPassName);
- HConstantFolding* fold1 = new (arena) HConstantFolding(graph, stats);
+ HConstantFolding* fold1 = new (arena) HConstantFolding(graph);
InstructionSimplifier* simplify1 = new (arena) InstructionSimplifier(graph, stats);
- HBooleanSimplifier* boolean_simplify = new (arena) HBooleanSimplifier(graph, stats);
- HConstantFolding* fold2 = new (arena) HConstantFolding(graph, stats, "constant_folding_after_inlining");
+ HBooleanSimplifier* boolean_simplify = new (arena) HBooleanSimplifier(graph);
+ HConstantFolding* fold2 = new (arena) HConstantFolding(graph, "constant_folding_after_inlining");
SideEffectsAnalysis* side_effects = new (arena) SideEffectsAnalysis(graph);
GVNOptimization* gvn = new (arena) GVNOptimization(graph, *side_effects);
LICM* licm = new (arena) LICM(graph, *side_effects);
@@ -507,7 +507,7 @@
InstructionSimplifier* simplify4 = new (arena) InstructionSimplifier(
graph, stats, "instruction_simplifier_before_codegen");
- IntrinsicsRecognizer* intrinsics = new (arena) IntrinsicsRecognizer(graph, driver, stats);
+ IntrinsicsRecognizer* intrinsics = new (arena) IntrinsicsRecognizer(graph, driver);
HOptimization* optimizations1[] = {
intrinsics,
diff --git a/compiler/optimizing/optimizing_compiler_stats.h b/compiler/optimizing/optimizing_compiler_stats.h
index 21af170..6375cf1 100644
--- a/compiler/optimizing/optimizing_compiler_stats.h
+++ b/compiler/optimizing/optimizing_compiler_stats.h
@@ -54,10 +54,6 @@
kRemovedCheckedCast,
kRemovedDeadInstruction,
kRemovedNullCheck,
- kConstantFolding,
- kBooleanSimplifier,
- kIntrinsicsRecognizer,
- kLICM,
kLastStat
};
@@ -125,10 +121,6 @@
case kRemovedCheckedCast: return "kRemovedCheckedCast";
case kRemovedDeadInstruction: return "kRemovedDeadInstruction";
case kRemovedNullCheck: return "kRemovedNullCheck";
- case kConstantFolding: return "kConstantFolding";
- case kBooleanSimplifier: return "kBooleanSimplifier";
- case kIntrinsicsRecognizer: return "kIntrinsicsRecognizer";
- case kLICM: return "kLICM";
case kLastStat: break; // Invalid to print out.
}