summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/optimizing_compiler.cc
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-06-18 15:46:47 +0100
committerNicolas Geoffray <ngeoffray@google.com>2015-06-22 11:45:32 +0100
commita04e7b7ceae01a7ceda41419e4c639a43e18361e (patch)
treeceafb0dceeb17948ee39c0280fa2460eec3e1ec5 /compiler/optimizing/optimizing_compiler.cc
parent096f357c5dda663c6fbb58bd0154c091aec51f63 (diff)
downloadart-a04e7b7ceae01a7ceda41419e4c639a43e18361e.zip
art-a04e7b7ceae01a7ceda41419e4c639a43e18361e.tar.gz
art-a04e7b7ceae01a7ceda41419e4c639a43e18361e.tar.bz2
Run a simplification pass before code generation.
The code generators assume things that only the instruction simplier ensures. So it has to be run last in case previous optimiziations broke those assumptions. bug:21865464 (cherry picked from commit b2bdfce7f805b00668a2521b1c939a0aafb2be49) Change-Id: Ibf4384a911e400eb7586bbf6b4edd6351034cbd8
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r--compiler/optimizing/optimizing_compiler.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 64d6023..810b4f8 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -337,6 +337,7 @@ static void RunOptimizations(HGraph* graph,
BoundsCheckElimination bce(graph);
ReferenceTypePropagation type_propagation(graph, dex_file, dex_compilation_unit, handles);
InstructionSimplifier simplify2(graph, stats, "instruction_simplifier_after_types");
+ InstructionSimplifier simplify3(graph, stats, "instruction_simplifier_before_codegen");
IntrinsicsRecognizer intrinsics(graph, dex_compilation_unit.GetDexFile(), driver);
@@ -357,6 +358,10 @@ static void RunOptimizations(HGraph* graph,
&type_propagation,
&simplify2,
&dce2,
+ // The codegen has a few assumptions that only the instruction simplifier can
+ // satisfy. For example, the code generator does not expect to see a
+ // HTypeConversion from a type to the same type.
+ &simplify3,
};
RunOptimizations(optimizations, arraysize(optimizations), pass_info_printer);