summaryrefslogtreecommitdiff
path: root/compiler/optimizing/inliner.cc
diff options
context:
space:
mode:
author Santiago Aboy Solanes <solanes@google.com> 2022-12-08 15:15:17 +0000
committer Santiago Aboy Solanes <solanes@google.com> 2022-12-12 14:14:57 +0000
commitb9df137d1dbdab1fdca13bb459705b6603e9328b (patch)
tree6aa74b24b130c96cb3216cbf7ff5a5bfba67186b /compiler/optimizing/inliner.cc
parent5a454c6ed6bb692f5881a68ea9177d50e735b101 (diff)
Allow to inline invokes that sometimes throw into try blocks
We supported inlining these invokes into regular blocks, and we can extend that support for try blocks too. Bug: 227283224 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: Id45a009adabc610f4bf7a0457880ad7b9d772178
Diffstat (limited to 'compiler/optimizing/inliner.cc')
-rw-r--r--compiler/optimizing/inliner.cc10
1 files changed, 1 insertions, 9 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 3e3b2d46ca..1f7ef2cf4c 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -1883,7 +1883,6 @@ bool HInliner::CanInlineBody(const HGraph* callee_graph,
HInvoke* invoke,
size_t* out_number_of_instructions,
bool is_speculative) const {
- const HBasicBlock* target_block = invoke->GetBlock();
ArtMethod* const resolved_method = callee_graph->GetArtMethod();
HBasicBlock* exit_block = callee_graph->GetExitBlock();
@@ -1905,14 +1904,7 @@ bool HInliner::CanInlineBody(const HGraph* callee_graph,
}
if (last_instruction->IsThrow()) {
- if (target_block->IsTryBlock()) {
- // TODO(ngeoffray): Support adding HTryBoundary in Hgraph::InlineInto.
- LOG_FAIL(stats_, MethodCompilationStat::kNotInlinedTryCatchCaller)
- << "Method " << resolved_method->PrettyMethod()
- << " could not be inlined because one branch always throws and"
- << " caller is in a try/catch block";
- return false;
- } else if (graph_->GetExitBlock() == nullptr) {
+ if (graph_->GetExitBlock() == nullptr) {
// TODO(ngeoffray): Support adding HExit in the caller graph.
LOG_FAIL(stats_, MethodCompilationStat::kNotInlinedInfiniteLoop)
<< "Method " << resolved_method->PrettyMethod()