Add register support to the optimizing compiler.
Also make if take an input and build the use list for instructions.
Change-Id: I1938cee7dce5bd4c66b259fa2b431d2c79b3cf82
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 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 @@
instruction->previous_ = last_instruction_;
last_instruction_ = instruction;
}
+ for (int i = 0; i < instruction->InputCount(); i++) {
+ instruction->InputAt(i)->AddUse(instruction);
+ }
}
#define DEFINE_ACCEPT(name) \