Add synthesize uses at back edge.
This reduces the cost of linearizing the graph (hence removing
the notion of back edge). Since linear scan allocates/spills registers
based on next use, adding a use at a back edge ensures we do count
for loop uses.
Change-Id: Idaa882cb120edbdd08ca6bff142d326a8245bd14
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index 0533bff..c16f6f5 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -397,6 +397,11 @@
return back_edges_;
}
+ HBasicBlock* GetSingleBackEdge() const {
+ DCHECK_EQ(back_edges_.Size(), 1u);
+ return back_edges_.Get(0);
+ }
+
void ClearBackEdges() {
back_edges_.Reset();
}