summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/nodes.cc
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2014-03-04 14:46:47 +0000
committerNicolas Geoffray <ngeoffray@google.com>2014-03-10 11:41:22 +0000
commit3ff386aafefd5282bb76c8a50506a70a4321e698 (patch)
tree5f6e990553daae150a168f581bac79e659f7f712 /compiler/optimizing/nodes.cc
parent0307b5c91c287e08cd414ecc5de32befceb7e371 (diff)
downloadart-3ff386aafefd5282bb76c8a50506a70a4321e698.zip
art-3ff386aafefd5282bb76c8a50506a70a4321e698.tar.gz
art-3ff386aafefd5282bb76c8a50506a70a4321e698.tar.bz2
Add register support to the optimizing compiler.
Also make if take an input and build the use list for instructions. Change-Id: I1938cee7dce5bd4c66b259fa2b431d2c79b3cf82
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r--compiler/optimizing/nodes.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index aefb089..16dfb94 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -122,6 +122,7 @@ void HGraph::VisitBlockForDominatorTree(HBasicBlock* block,
void HBasicBlock::AddInstruction(HInstruction* instruction) {
instruction->set_block(this);
+ instruction->set_id(graph()->GetNextInstructionId());
if (first_instruction_ == nullptr) {
DCHECK(last_instruction_ == nullptr);
first_instruction_ = last_instruction_ = instruction;
@@ -130,6 +131,9 @@ void HBasicBlock::AddInstruction(HInstruction* instruction) {
instruction->previous_ = last_instruction_;
last_instruction_ = instruction;
}
+ for (int i = 0; i < instruction->InputCount(); i++) {
+ instruction->InputAt(i)->AddUse(instruction);
+ }
}
#define DEFINE_ACCEPT(name) \