diff options
author | 2022-07-22 15:21:29 +0100 | |
---|---|---|
committer | 2022-08-09 09:44:21 +0000 | |
commit | c6b816ceb2b35300c937ef2e7d008598b6afba21 (patch) | |
tree | 9bb081881ddd8e237521c9513c7ce6160fa6db11 /compiler/optimizing/constant_folding_test.cc | |
parent | e6d405470c12c4dfd5f7757e9e951751a23622d3 (diff) |
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
Diffstat (limited to 'compiler/optimizing/constant_folding_test.cc')
-rw-r--r-- | compiler/optimizing/constant_folding_test.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/optimizing/constant_folding_test.cc b/compiler/optimizing/constant_folding_test.cc index 74d9d3a993..3bcdc1ce40 100644 --- a/compiler/optimizing/constant_folding_test.cc +++ b/compiler/optimizing/constant_folding_test.cc @@ -58,7 +58,7 @@ class ConstantFoldingTest : public OptimizingUnitTest { std::string actual_before = printer_before.str(); EXPECT_EQ(expected_before, actual_before); - HConstantFolding(graph_, "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()); |