From c6b816ceb2b35300c937ef2e7d008598b6afba21 Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Fri, 22 Jul 2022 15:21:29 +0100 Subject: Propagating values from if clauses to its successors We have knowledge of the value of some variables at compile time due to the fact they are used in if clauses. For example: if (variable == constant) { // SSA `variable` guaranteed to be equal to constant here. } else { // No guarantees can be made here (except for booleans since // they only have two values). } Similarly with `variable != constant`. We can also apply this to boolean parameters e.g. void foo (boolean val) { if (val) { // `val` guaranteed to be true here. ... } ... } Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I55df0252d672870993d06e5ac92f5bba44d902bd --- compiler/optimizing/optimization.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/optimizing/optimization.cc') diff --git a/compiler/optimizing/optimization.cc b/compiler/optimizing/optimization.cc index 2cac38b715..7bf6dbb741 100644 --- a/compiler/optimizing/optimization.cc +++ b/compiler/optimizing/optimization.cc @@ -221,7 +221,7 @@ ArenaVector ConstructOptimizations( // Regular passes. // case OptimizationPass::kConstantFolding: - opt = new (allocator) HConstantFolding(graph, pass_name); + opt = new (allocator) HConstantFolding(graph, stats, pass_name); break; case OptimizationPass::kDeadCodeElimination: opt = new (allocator) HDeadCodeElimination(graph, stats, pass_name); -- cgit v1.2.3-59-g8ed1b