summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2015-11-23 08:59:07 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2015-11-23 08:59:07 +0000
commite34648dec914453f7e8b6c517dd272823319cd6d (patch)
treeb192c4698c4889ae90db6abe2652199802213fe6
parent06241b1b07fb031b7d2cf55f4b78d3444d07cc2d (diff)
Revert "Add stats support for existing optimizations"
Breaks the build. Please ensure your changes build. This reverts commit 06241b1b07fb031b7d2cf55f4b78d3444d07cc2d. Change-Id: I68b18f99a9882719bf6654d3313531a7965b8483
-rw-r--r--compiler/optimizing/boolean_simplifier.cc4
-rw-r--r--compiler/optimizing/boolean_simplifier.h4
-rw-r--r--compiler/optimizing/constant_folding.cc4
-rw-r--r--compiler/optimizing/constant_folding.h6
-rw-r--r--compiler/optimizing/inliner.cc4
-rw-r--r--compiler/optimizing/intrinsics.cc1
-rw-r--r--compiler/optimizing/intrinsics.h4
-rw-r--r--compiler/optimizing/licm.cc1
-rw-r--r--compiler/optimizing/licm.h5
-rw-r--r--compiler/optimizing/optimizing_compiler.cc8
-rw-r--r--compiler/optimizing/optimizing_compiler_stats.h8
11 files changed, 14 insertions, 35 deletions
diff --git a/compiler/optimizing/boolean_simplifier.cc b/compiler/optimizing/boolean_simplifier.cc
index c3e88f39c3..f985745e7a 100644
--- a/compiler/optimizing/boolean_simplifier.cc
+++ b/compiler/optimizing/boolean_simplifier.cc
@@ -36,8 +36,6 @@ void HBooleanSimplifier::TryRemovingNegatedCondition(HBasicBlock* block) {
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 @@ void HBooleanSimplifier::TryRemovingBooleanSelection(HBasicBlock* block) {
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 0eb6c71c1c..e12a12c95b 100644
--- a/compiler/optimizing/boolean_simplifier.h
+++ b/compiler/optimizing/boolean_simplifier.h
@@ -62,8 +62,8 @@ namespace art {
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 1db775ecab..57452cc076 100644
--- a/compiler/optimizing/constant_folding.cc
+++ b/compiler/optimizing/constant_folding.cc
@@ -68,7 +68,6 @@ void HConstantFolding::Run() {
} 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 @@ void HConstantFolding::Run() {
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 @@ void HConstantFolding::Run() {
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 @@ void HConstantFolding::Run() {
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 df893710df..2698b2d690 100644
--- a/compiler/optimizing/constant_folding.h
+++ b/compiler/optimizing/constant_folding.h
@@ -32,10 +32,8 @@ namespace art {
*/
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 b33f6f2398..0363f203b2 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -395,11 +395,11 @@ bool HInliner::TryBuildAndInline(ArtMethod* resolved_method,
// 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 9516f01c91..b01324ec3b 100644
--- a/compiler/optimizing/intrinsics.cc
+++ b/compiler/optimizing/intrinsics.cc
@@ -438,7 +438,6 @@ void IntrinsicsRecognizer::Run() {
<< invoke->DebugName();
} else {
invoke->SetIntrinsic(intrinsic, NeedsEnvironmentOrCache(intrinsic));
- MaybeRecordStat(MethodCompilationStat::kIntrinsicsRecognizer);
}
}
}
diff --git a/compiler/optimizing/intrinsics.h b/compiler/optimizing/intrinsics.h
index cc4f708116..e459516e59 100644
--- a/compiler/optimizing/intrinsics.h
+++ b/compiler/optimizing/intrinsics.h
@@ -30,8 +30,8 @@ class DexFile;
// 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 6d0a616a54..c38bbe3477 100644
--- a/compiler/optimizing/licm.cc
+++ b/compiler/optimizing/licm.cc
@@ -123,7 +123,6 @@ void LICM::Run() {
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 bf56f53d46..0b5a0f103b 100644
--- a/compiler/optimizing/licm.h
+++ b/compiler/optimizing/licm.h
@@ -26,9 +26,8 @@ class SideEffectsAnalysis;
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 24f0d779d7..2204921c53 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -487,10 +487,10 @@ static void RunOptimizations(HGraph* graph,
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 @@ static void RunOptimizations(HGraph* graph,
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 21af170419..6375cf1a56 100644
--- a/compiler/optimizing/optimizing_compiler_stats.h
+++ b/compiler/optimizing/optimizing_compiler_stats.h
@@ -54,10 +54,6 @@ enum MethodCompilationStat {
kRemovedCheckedCast,
kRemovedDeadInstruction,
kRemovedNullCheck,
- kConstantFolding,
- kBooleanSimplifier,
- kIntrinsicsRecognizer,
- kLICM,
kLastStat
};
@@ -125,10 +121,6 @@ class OptimizingCompilerStats {
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.
}