From 06241b1b07fb031b7d2cf55f4b78d3444d07cc2d Mon Sep 17 00:00:00 2001 From: Jean-Philippe Halimi Date: Thu, 3 Sep 2015 17:28:38 +0200 Subject: Add stats support for existing optimizations This patch adds support for the --dump-stats facility with existing optimizations. Change-Id: I68751b119a030952a11057cb651a3c63e87e73ea Signed-off-by: Jean-Philippe Halimi --- compiler/optimizing/constant_folding.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/optimizing/constant_folding.cc') diff --git a/compiler/optimizing/constant_folding.cc b/compiler/optimizing/constant_folding.cc index 57452cc076..1db775ecab 100644 --- a/compiler/optimizing/constant_folding.cc +++ b/compiler/optimizing/constant_folding.cc @@ -68,6 +68,7 @@ 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. @@ -76,6 +77,7 @@ 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. @@ -84,6 +86,7 @@ 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(); @@ -92,6 +95,7 @@ void HConstantFolding::Run() { check->ReplaceWith(check_input); check->GetBlock()->RemoveInstruction(check); } + MaybeRecordStat(MethodCompilationStat::kConstantFolding); } } } -- cgit v1.2.3-59-g8ed1b