summaryrefslogtreecommitdiff
path: root/compiler/dex/mir_graph.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2014-05-30 10:37:52 +0000
committer Android Git Automerger <android-git-automerger@android.com> 2014-05-30 10:37:52 +0000
commit3b93ef7fd8a5a4d816b146a95b3e54e0331cc51c (patch)
tree3360085a96e24e427ac66129f1d54a11b044c653 /compiler/dex/mir_graph.cc
parent58b340b0e179981497bc88b7fff996e039502a8d (diff)
parentb827c44f39f66fce600408f82988d6e154627ba7 (diff)
am b827c44f: Merge "ART: Setting up cleanup"
* commit 'b827c44f39f66fce600408f82988d6e154627ba7': ART: Setting up cleanup
Diffstat (limited to 'compiler/dex/mir_graph.cc')
-rw-r--r--compiler/dex/mir_graph.cc41
1 files changed, 16 insertions, 25 deletions
diff --git a/compiler/dex/mir_graph.cc b/compiler/dex/mir_graph.cc
index 0fffa01350..99dd50a53c 100644
--- a/compiler/dex/mir_graph.cc
+++ b/compiler/dex/mir_graph.cc
@@ -26,6 +26,7 @@
#include "dex/quick/dex_file_to_method_inliner_map.h"
#include "dex/quick/dex_file_method_inliner.h"
#include "leb128.h"
+#include "pass_driver_me_post_opt.h"
namespace art {
@@ -353,7 +354,7 @@ BasicBlock* MIRGraph::ProcessCanBranch(BasicBlock* cur_block, MIR* insn, DexOffs
/* Always terminate the current block for conditional branches */
if (flags & Instruction::kContinue) {
- BasicBlock *fallthrough_block = FindBlock(cur_offset + width,
+ BasicBlock* fallthrough_block = FindBlock(cur_offset + width,
/*
* If the method is processed
* in sequential order from the
@@ -541,7 +542,7 @@ BasicBlock* MIRGraph::ProcessCanThrow(BasicBlock* cur_block, MIR* insn, DexOffse
* Note also that the dex_pc_to_block_map_ entry for the potentially
* throwing instruction will refer to the original basic block.
*/
- BasicBlock *new_block = NewMemBB(kDalvikByteCode, num_blocks_++);
+ BasicBlock* new_block = NewMemBB(kDalvikByteCode, num_blocks_++);
block_list_.Insert(new_block);
new_block->start_offset = insn->offset;
cur_block->fall_through = new_block->id;
@@ -724,7 +725,7 @@ void MIRGraph::InlineMethod(const DexFile::CodeItem* code_item, uint32_t access_
}
}
current_offset_ += width;
- BasicBlock *next_block = FindBlock(current_offset_, /* split */ false, /* create */
+ BasicBlock* next_block = FindBlock(current_offset_, /* split */ false, /* create */
false, /* immed_pred_block_p */ NULL);
if (next_block) {
/*
@@ -1418,25 +1419,6 @@ void MIRGraph::SSATransformationStart() {
temp_bit_vector_ = new (temp_scoped_alloc_.get()) ArenaBitVector(
temp_scoped_alloc_.get(), temp_bit_vector_size_, false, kBitMapRegisterV);
- /* Compute the DFS order */
- ComputeDFSOrders();
-
- /* Compute the dominator info */
- ComputeDominators();
-
- /* Allocate data structures in preparation for SSA conversion */
- CompilerInitializeSSAConversion();
-
- /* Find out the "Dalvik reg def x block" relation */
- ComputeDefBlockMatrix();
-
- /* Insert phi nodes to dominance frontiers for all variables */
- InsertPhiNodes();
-
- /* Rename register names by local defs and phi nodes */
- ClearAllVisitedFlags();
- DoDFSPreOrderSSARename(GetEntryBlock());
-
// Update the maximum number of reachable blocks.
max_num_reachable_blocks_ = num_reachable_blocks_;
}
@@ -1454,7 +1436,7 @@ void MIRGraph::SSATransformationEnd() {
}
void MIRGraph::ComputeTopologicalSortOrder() {
- std::queue<BasicBlock *> q;
+ std::queue<BasicBlock*> q;
std::map<int, int> visited_cnt_values;
// Clear the nodes.
@@ -1510,7 +1492,7 @@ void MIRGraph::ComputeTopologicalSortOrder() {
while (q.size() > 0) {
// Get top.
- BasicBlock *bb = q.front();
+ BasicBlock* bb = q.front();
q.pop();
DCHECK_EQ(bb->hidden, false);
@@ -1528,7 +1510,7 @@ void MIRGraph::ComputeTopologicalSortOrder() {
// Reduce visitedCnt for all the successors and add into the queue ones with visitedCnt equals to zero.
ChildBlockIterator succIter(bb, this);
- BasicBlock *successor = succIter.Next();
+ BasicBlock* successor = succIter.Next();
while (successor != nullptr) {
// one more predecessor was visited.
visited_cnt_values[successor->id]--;
@@ -1914,4 +1896,13 @@ BasicBlock* MIRGraph::CreateNewBB(BBType block_type) {
return res;
}
+void MIRGraph::CalculateBasicBlockInformation() {
+ PassDriverMEPostOpt driver(cu_);
+ driver.Launch();
+}
+
+void MIRGraph::InitializeBasicBlockData() {
+ num_blocks_ = block_list_.Size();
+}
+
} // namespace art