From 46e2a3915aa68c77426b71e95b9f3658250646b7 Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Mon, 16 Mar 2015 17:31:52 +0000 Subject: ART: Boolean simplifier The optimization recognizes the negation pattern generated by 'javac' and replaces it with a single condition. To this end, boolean values are now consistently assumed to be represented by an integer. This is a first optimization which deletes blocks from the HGraph and does so by replacing the corresponding entries with null. Hence, existing code can continue indexing the list of blocks with the block ID, but must check for null when iterating over the list. Change-Id: I7779da69cfa925c6521938ad0bcc11bc52335583 --- compiler/optimizing/optimizing_compiler.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/optimizing/optimizing_compiler.cc') diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 933a8a005c..ea969dcb44 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -22,6 +22,7 @@ #include "base/arena_allocator.h" #include "base/dumpable.h" #include "base/timing_logger.h" +#include "boolean_simplifier.h" #include "bounds_check_elimination.h" #include "builder.h" #include "code_generator.h" @@ -313,6 +314,7 @@ static void RunOptimizations(HGraph* graph, HDeadCodeElimination dce(graph); HConstantFolding fold1(graph); InstructionSimplifier simplify1(graph, stats); + HBooleanSimplifier boolean_not(graph); HInliner inliner(graph, dex_compilation_unit, driver, stats); @@ -331,6 +333,9 @@ static void RunOptimizations(HGraph* graph, &dce, &fold1, &simplify1, + // BooleanSimplifier depends on the InstructionSimplifier removing redundant + // suspend checks to recognize empty blocks. + &boolean_not, &inliner, &fold2, &side_effects, -- cgit v1.2.3-59-g8ed1b