From 1eede6ae9b08d305d0c1123284ff958373916474 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 2 Mar 2017 16:14:53 +0000 Subject: Don't inline methods that throw in graph with irreducible loops. Re-computing the loop information is not supported in graphs with irreducible loops, as it is not deterministic, and the loop header of a loop could change. That would lead to having the suspend check in the wrong block. Test: test-art-host Test: 641-irreducible-inline bug: 35757766 Change-Id: I6a435885461fbeca035e4f5d94f055fc3262adca --- compiler/optimizing/inliner.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'compiler/optimizing/inliner.cc') diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc index 3e340908bf..14437dea39 100644 --- a/compiler/optimizing/inliner.cc +++ b/compiler/optimizing/inliner.cc @@ -1380,6 +1380,13 @@ bool HInliner::TryBuildAndInlineHelper(HInvoke* invoke_instruction, << " could not be inlined because one branch always throws and" << " caller does not have an exit block"; return false; + } else if (graph_->HasIrreducibleLoops()) { + // TODO(ngeoffray): Support re-computing loop information to graphs with + // irreducible loops? + VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index) + << " could not be inlined because one branch always throws and" + << " caller has irreducible loops"; + return false; } } else { has_one_return = true; -- cgit v1.2.3-59-g8ed1b