From f0a31e107973f3bde7dd54cd7610082b104922db Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Fri, 12 Jan 2024 18:40:49 +0000 Subject: Revert "Restrict the use of ConstantFolding's VisitIf" This reverts commit 5eb1fd0dae3832ceee2102613bb08c291daca6f3. Reason for revert: In aosp/2903248 we implemented a faster way of doing `ReplaceUsesDominatedBy` which is used by `VisitIf`. The impact of `VisitIf` is now small enough that running VisitIf in all passes is faster that the previous implementation running some of the time. This CLs re-enables the optimization in all constant folding passes because: A) Lets this optimization (and others that can use the result) kick in earlier B) Run it for callee graphs in the inliner (which has been disabled as of CL aosp/2543831) C) Consistency of the ConstantFolding pass, which helps to have a simpler mental model Bug: 278626992 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Test: Locally compiled GMS and compared time to compile Change-Id: I5dc5f591557c8de0bc4d23dbfd0b91b5b7e56ab5 --- compiler/optimizing/constant_folding_test.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'compiler/optimizing/constant_folding_test.cc') diff --git a/compiler/optimizing/constant_folding_test.cc b/compiler/optimizing/constant_folding_test.cc index acdc8e6d3c..689d77111c 100644 --- a/compiler/optimizing/constant_folding_test.cc +++ b/compiler/optimizing/constant_folding_test.cc @@ -60,9 +60,7 @@ class ConstantFoldingTest : public CommonCompilerTest, public OptimizingUnitTest std::string actual_before = printer_before.str(); EXPECT_EQ(expected_before, actual_before); - HConstantFolding constant_folding( - graph_, /* stats= */ nullptr, "constant_folding", /* use_all_optimizations= */ true); - constant_folding.Run(); + HConstantFolding(graph_, /* stats= */ nullptr, "constant_folding").Run(); GraphChecker graph_checker_cf(graph_); graph_checker_cf.Run(); ASSERT_TRUE(graph_checker_cf.IsValid()); -- cgit v1.2.3-59-g8ed1b