summaryrefslogtreecommitdiff
path: root/compiler/optimizing/builder.cc
diff options
context:
space:
mode:
author David Brazdil <dbrazdil@google.com> 2015-02-02 19:11:29 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-02-02 19:11:30 +0000
commit4336b97fc291d28f883607c88feaff202a684a59 (patch)
tree85b03421bd901f43bc37ce070292e6ab206d812b /compiler/optimizing/builder.cc
parentec57f287ba0475e9f9e6dad749b67625d0c0d92e (diff)
parent2fd6aa5cb76f0c71cbdcd1189c76e68bf84e8308 (diff)
Merge "Fix broken gtests after SuspendCheck optimization"
Diffstat (limited to 'compiler/optimizing/builder.cc')
-rw-r--r--compiler/optimizing/builder.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc
index eed56146e3..c50960666a 100644
--- a/compiler/optimizing/builder.cc
+++ b/compiler/optimizing/builder.cc
@@ -1077,11 +1077,10 @@ void HGraphBuilder::PotentiallyAddSuspendCheck(HBasicBlock* target, uint32_t dex
if (target_offset <= 0) {
// DX generates back edges to the first encountered return. We can save
// time of later passes by not adding redundant suspend checks.
- if (target_offset != 0) {
- DCHECK(target->GetLastInstruction() != nullptr);
- if (target->GetLastInstruction()->IsReturn()) {
- return;
- }
+ HInstruction* last_in_target = target->GetLastInstruction();
+ if (last_in_target != nullptr &&
+ (last_in_target->IsReturn() || last_in_target->IsReturnVoid())) {
+ return;
}
// Add a suspend check to backward branches which may potentially loop. We