Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Unified Diff: runtime/vm/flow_graph_allocator.cc

Issue 393323004: Support SameAsFirstInput policy in register allocator when inputs are paired machine registers (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_allocator.cc
diff --git a/runtime/vm/flow_graph_allocator.cc b/runtime/vm/flow_graph_allocator.cc
index bb092dfc8c810bf52cb39c8c94129f9e5035f006..e5f0865d8bff0b89cfb3aee8f42c5db0488d555b 100644
--- a/runtime/vm/flow_graph_allocator.cc
+++ b/runtime/vm/flow_graph_allocator.cc
@@ -1150,9 +1150,20 @@ void FlowGraphAllocator::ProcessOneInstruction(BlockEntryInstr* block,
// Normalize same-as-first-input output if input is specified as
// fixed register.
if (locs->out(0).IsUnallocated() &&
- (locs->out(0).policy() == Location::kSameAsFirstInput) &&
- (locs->in(0).IsMachineRegister())) {
- locs->set_out(0, locs->in(0));
+ (locs->out(0).policy() == Location::kSameAsFirstInput)) {
+ if (locs->in(0).IsPairLocation()) {
+ // Pair input, pair output.
+ PairLocation* in_pair = locs->in(0).AsPairLocation();
+ ASSERT(in_pair->At(0).IsMachineRegister() ==
+ in_pair->At(1).IsMachineRegister());
+ if (in_pair->At(0).IsMachineRegister() &&
+ in_pair->At(1).IsMachineRegister()) {
+ locs->set_out(0, Location::Pair(in_pair->At(0), in_pair->At(1)));
+ }
+ } else if (locs->in(0).IsMachineRegister()) {
+ // Single input, single output.
+ locs->set_out(0, locs->in(0));
+ }
}
const bool output_same_as_first_input =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698