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

Side by Side Diff: runtime/vm/flow_graph_allocator.cc

Issue 10832159: Don't mark register constraints resolution moves as prefering registers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« runtime/vm/compiler.cc ('K') | « runtime/vm/compiler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/flow_graph_allocator.h" 5 #include "vm/flow_graph_allocator.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 #include "vm/il_printer.h" 9 #include "vm/il_printer.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 694
695 if (in_ref->IsRegister()) { 695 if (in_ref->IsRegister()) {
696 // Input is expected in a fixed register. Expected shape of 696 // Input is expected in a fixed register. Expected shape of
697 // live ranges: 697 // live ranges:
698 // 698 //
699 // j' i i' 699 // j' i i'
700 // value --* 700 // value --*
701 // register [-----) 701 // register [-----)
702 // 702 //
703 MoveOperands* move = 703 MoveOperands* move =
704 AddMoveAt(pos - 1, *in_ref, Location::PrefersRegister()); 704 AddMoveAt(pos - 1, *in_ref, Location::Any());
705 BlockLocation(*in_ref, pos - 1, pos + 1); 705 BlockLocation(*in_ref, pos - 1, pos + 1);
706 range->AddUseInterval(block->start_pos(), pos - 1); 706 range->AddUseInterval(block->start_pos(), pos - 1);
707 range->AddUse(pos - 1, move->src_slot()); 707 range->AddUse(pos - 1, move->src_slot());
708 } else { 708 } else {
709 // Normal unallocated input. Expected shape of 709 // Normal unallocated input. Expected shape of
710 // live ranges: 710 // live ranges:
711 // 711 //
712 // i i' 712 // i i'
713 // value -----* 713 // value -----*
714 // 714 //
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 // Remove first use. It was allocated. 814 // Remove first use. It was allocated.
815 range->set_first_use(range->first_use()->next()); 815 range->set_first_use(range->first_use()->next());
816 } 816 }
817 817
818 // Shorten live range to the point of definition, this might make the range 818 // Shorten live range to the point of definition, this might make the range
819 // empty (if the only use immediately follows). If range is not empty add 819 // empty (if the only use immediately follows). If range is not empty add
820 // move from a fixed register to an unallocated location. 820 // move from a fixed register to an unallocated location.
821 range->DefineAt(pos + 1); 821 range->DefineAt(pos + 1);
822 if (range->Start() == range->End()) return; 822 if (range->Start() == range->End()) return;
823 823
824 MoveOperands* move = AddMoveAt(pos + 1, Location::PrefersRegister(), *out); 824 MoveOperands* move = AddMoveAt(pos + 1, Location::Any(), *out);
825 range->AddUse(pos + 1, move->dest_slot()); 825 range->AddUse(pos + 1, move->dest_slot());
826 } else if (output_same_as_first_input) { 826 } else if (output_same_as_first_input) {
827 // Output register will contain a value of the first input at instruction's 827 // Output register will contain a value of the first input at instruction's
828 // start. Expected shape of live ranges: 828 // start. Expected shape of live ranges:
829 // 829 //
830 // i i' 830 // i i'
831 // input #0 --* 831 // input #0 --*
832 // output [---- 832 // output [----
833 // 833 //
834 ASSERT(locs->in_slot(0)->Equals(Location::RequiresRegister())); 834 ASSERT(locs->in_slot(0)->Equals(Location::RequiresRegister()));
835 835
836 // Create move that will copy value between input and output. 836 // Create move that will copy value between input and output.
837 locs->set_out(Location::RequiresRegister()); 837 locs->set_out(Location::RequiresRegister());
838 MoveOperands* move = AddMoveAt(pos, 838 MoveOperands* move = AddMoveAt(pos,
839 Location::RequiresRegister(), 839 Location::RequiresRegister(),
840 Location::PrefersRegister()); 840 Location::Any());
841 841
842 // Add uses to the live range of the input. 842 // Add uses to the live range of the input.
843 Value* input = current->InputAt(0); 843 Value* input = current->InputAt(0);
844 ASSERT(input->IsUse()); // Can not be a constant currently. 844 ASSERT(input->IsUse()); // Can not be a constant currently.
845 LiveRange* input_range = GetLiveRange( 845 LiveRange* input_range = GetLiveRange(
846 input->AsUse()->definition()->ssa_temp_index()); 846 input->AsUse()->definition()->ssa_temp_index());
847 input_range->AddUseInterval(block->start_pos(), pos); 847 input_range->AddUseInterval(block->start_pos(), pos);
848 input_range->AddUse(pos, move->src_slot()); 848 input_range->AddUse(pos, move->src_slot());
849 849
850 // Shorten output live range to the point of definition and add both input 850 // Shorten output live range to the point of definition and add both input
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after
1882 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", 1882 OS::Print("-- [after ssa allocator] ir [%s] -------------\n",
1883 function.ToFullyQualifiedCString()); 1883 function.ToFullyQualifiedCString());
1884 FlowGraphPrinter printer(Function::Handle(), block_order_, true); 1884 FlowGraphPrinter printer(Function::Handle(), block_order_, true);
1885 printer.PrintBlocks(); 1885 printer.PrintBlocks();
1886 OS::Print("----------------------------------------------\n"); 1886 OS::Print("----------------------------------------------\n");
1887 } 1887 }
1888 } 1888 }
1889 1889
1890 1890
1891 } // namespace dart 1891 } // namespace dart
OLDNEW
« runtime/vm/compiler.cc ('K') | « runtime/vm/compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698