diff options
author | 2022-07-15 14:30:05 +0100 | |
---|---|---|
committer | 2022-07-19 17:14:07 +0000 | |
commit | 78f3d3a7b2d795cc0915218abafb0d5b47aa2225 (patch) | |
tree | 99e81bb3500b109396d0cc4d9fe4b71557afeed7 /compiler/optimizing/inliner.cc | |
parent | 27aecbb0180a98a672a8ab96b763d0864105d266 (diff) |
Improve DCE's SimplifyAlwaysThrows regarding Invoke location
Allow SimplifyAlwaysThrows to run on any invoke that always throws,
and not just the second to last instruction.
As a bonus, there are two places that would make a graph have
invokes that always throws:
1) When inlining a method that has invokes that always throw.
2) When trying to inline a method, and not doing it since it
always throws.
Since we only have those two places, we can add a flag to the graph
that tracks this. We then skip the SimplifyAlwaysThrows optimization
altogether if the graph doesn't have that flag set.
Bug: 227316307
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Change-Id: Ia353fcf2c055885cc04e10790584210c2e488e32
Diffstat (limited to 'compiler/optimizing/inliner.cc')
-rw-r--r-- | compiler/optimizing/inliner.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc index 2b8c04b4a5..d8ace5eadd 100644 --- a/compiler/optimizing/inliner.cc +++ b/compiler/optimizing/inliner.cc @@ -201,6 +201,10 @@ bool HInliner::Run() { } } + if (did_set_always_throws) { + graph_->SetHasAlwaysThrowingInvokes(/* value= */ true); + } + return did_inline || did_set_always_throws; } |