summaryrefslogtreecommitdiff
path: root/src/compiler/dataflow.cc
diff options
context:
space:
mode:
author buzbee <buzbee@google.com> 2013-02-07 09:33:02 -0800
committer buzbee <buzbee@google.com> 2013-02-07 10:39:53 -0800
commitbbdd05378516f11443fce29a0fbff25ad993db23 (patch)
tree29b8d389ec032b8d09d82ec801909a6535f665c4 /src/compiler/dataflow.cc
parent8dbb708c7dc05c786329eb5c3fff3194ab6472ac (diff)
[Portable Compiler] Rework return block marking.
Move the detection of blocks that contain a return from the GBC emit pass up to Dex parsing. This allows logic that detects backward branches that go to method return to skip suspend checks. Change-Id: I2a606b49850235b59c5faf237a08729e98220f4d
Diffstat (limited to 'src/compiler/dataflow.cc')
-rw-r--r--src/compiler/dataflow.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/compiler/dataflow.cc b/src/compiler/dataflow.cc
index 1e20cbd025..4d7e9d7a89 100644
--- a/src/compiler/dataflow.cc
+++ b/src/compiler/dataflow.cc
@@ -1890,6 +1890,11 @@ static bool CombineBlocks(struct CompilationUnit* cu, struct BasicBlock* bb)
bb->taken = bb_next->taken;
// Include the rest of the instructions
bb->last_mir_insn = bb_next->last_mir_insn;
+ /*
+ * If lower-half of pair of blocks to combine contained a return, move the flag
+ * to the newly combined block.
+ */
+ bb->terminated_by_return = bb_next->terminated_by_return;
/*
* NOTE: we aren't updating all dataflow info here. Should either make sure this pass
@@ -2096,17 +2101,17 @@ bool BuildExtendedBBList(struct CompilationUnit* cu, struct BasicBlock* bb)
}
BasicBlock* start_bb = bb;
cu->extended_basic_blocks.push_back(bb);
- bool has_return = false;
+ bool terminated_by_return = false;
// Visit blocks strictly dominated by this head.
while (bb != NULL) {
bb->visited = true;
- has_return |= bb->has_return;
+ terminated_by_return |= bb->terminated_by_return;
bb = NextDominatedBlock(cu, bb);
if (cu->verbose && (bb != NULL)) {
LOG(INFO) << "...added bb " << bb->id;
}
}
- if (has_return) {
+ if (terminated_by_return) {
// This extended basic block contains a return, so mark all members.
bb = start_bb;
while (bb != NULL) {