Home | History | Annotate | Download | only in optimizing

Lines Matching defs:move

26   // moves to perform, ignoring any move that is redundant (the source is
28 // unallocated, or the move was already eliminated).
30 MoveOperands* move = parallel_move->MoveOperandsAt(i);
31 if (!move->IsRedundant()) {
32 moves_.push_back(move);
42 // Move stack/stack slot to take advantage of a free register on constrained machines.
44 const MoveOperands& move = *moves_[i];
46 if (move.IsEliminated() || move.GetSource().IsConstant()) {
50 if ((move.GetSource().IsStackSlot() || move.GetSource().IsDoubleStackSlot()) &&
51 (move.GetDestination().IsStackSlot() || move.GetDestination().IsDoubleStackSlot())) {
57 const MoveOperands& move = *moves_[i];
61 if (!move.IsEliminated() && !move.GetSource().IsConstant()) {
68 MoveOperands* move = moves_[i];
69 if (!move->IsEliminated()) {
70 DCHECK(move->GetSource().IsConstant());
72 // Eliminate the move, in case following moves need a scratch register.
73 move->Eliminate();
104 // Update the source of `move`, knowing that `updated_location` has been swapped
106 // `move` is non-pair, we need to extract which register to use.
107 static void UpdateSourceOf(MoveOperands* move, Location updated_location, Location new_source) {
108 Location source = move->GetSource();
110 move->SetSource(LowOf(new_source));
112 move->SetSource(HighOf(new_source));
115 move->SetSource(new_source);
120 // Each call to this function performs a move and deletes it from the move
121 // graph. We first recursively perform any move blocking this one. We
122 // mark a move as "pending" on entry to PerformMove in order to detect
123 // cycles in the move graph. We use operand swaps to resolve cycles,
125 // in the move graph.
127 MoveOperands* move = moves_[index];
128 DCHECK(!move->IsPending());
129 if (move->IsRedundant()) {
132 move->Eliminate();
136 // Clear this move's destination to indicate a pending move. The actual
139 DCHECK(!move->GetSource().IsInvalid());
140 Location destination = move->MarkPending();
142 // Perform a depth-first traversal of the move graph to resolve
143 // dependencies. Any unperformed, unpending move with a source the same
150 // Though PerformMove can change any source operand in the move graph,
151 // calling `PerformMove` cannot create a blocking move via a swap
153 // For example, assume there is a non-blocking move with source A
154 // and this move is blocked on source B and there is a swap of A and
156 // not be swapped). Since this move's destination is B and there is
157 // only a single incoming edge to an operand, this move must also be
158 // involved in the same cycle. In that case, the blocking move will
162 if (required_swap == move) {
163 // If this move is required to swap, we do so without looking
173 // A move is required to swap. We walk back the cycle to find the
174 // move by just returning from this `PerformMove`.
181 // We are about to resolve this move and don't need it marked as
183 move->ClearPending(destination);
185 // This move's source may have changed due to swaps to resolve cycles and
186 // so it may now be the last move in the cycle. If so remove it.
187 if (move->GetSource().Equals(destination)) {
188 move->Eliminate();
193 // The move may be blocked on a (at most one) pending move, in which case
194 // we have a cycle. Search for such a blocking move and perform a swap to
198 DCHECK_EQ(required_swap, move);
203 DCHECK(other_move->IsPending()) << "move=" << *move << " other_move=" << *other_move;
204 if (!move->Is64BitMove() && other_move->Is64BitMove()) {
206 // cycle by returning the move that must be swapped.
217 // Any unperformed (including pending) move with a source of either
218 // this move's source or destination needs to have their source
220 Location source = move->GetSource();
221 Location swap_destination = move->GetDestination();
222 move->Eliminate();
230 // If the swap was required because of a 64bits move in the middle of a cycle,
231 // we return the swapped move, so that the caller knows it needs to re-iterate
235 // This move is not blocked.
237 move->Eliminate();
244 for (MoveOperands* move : moves_) {
245 if (move->Blocks(loc)) {
250 for (MoveOperands* move : moves_) {
251 if (move->GetDestination().Equals(loc)) {
314 const MoveOperands& move = *moves_[i];
318 if (!move.IsEliminated() && !move.GetSource().IsConstant()) {
327 MoveOperands* move = moves_[i];
328 Location destination = move->GetDestination();
329 if (!move->IsEliminated() && !destination.IsStackSlot() && !destination.IsDoubleStackSlot()) {
330 Location source = move->GetSource();
332 move->Eliminate();
347 MoveOperands* move = moves_[i];
348 if (!move->IsEliminated()) {
350 move->Eliminate();
370 for (MoveOperands* move : moves_) {
371 Location loc = move->GetDestination();
399 // Each call to this function performs a move and deletes it from the move
400 // graph. We first recursively perform any move blocking this one. We mark
401 // a move as "pending" on entry to PerformMove in order to detect cycles
402 // in the move graph. We use scratch location to resolve cycles, also
403 // additional pending moves might be added. After move has been performed,
404 // we will update source operand in the move graph to reduce dependencies in
407 MoveOperands* move = moves_[index];
408 DCHECK(!move->IsPending());
409 DCHECK(!move->IsEliminated());
410 if (move->IsRedundant()) {
411 // Previous operations on the list of moves have caused this particular move
415 // used as the scratch location, the move (1 -> 2) will occur while resolving
416 // the cycle. When that move is emitted, the code will update moves with a '1'
418 // the initial move (1 -> 2) would then become the no-op (2 -> 2) that can be
420 move->Eliminate();
424 // Clear this move's destination to indicate a pending move. The actual
427 DCHECK(!move->GetSource().IsInvalid());
428 Location destination = move->MarkPending();
430 // Perform a depth-first traversal of the move graph to resolve
431 // dependencies. Any unperformed, unpending move with a source the same
441 // We are about to resolve this move and don't need it marked as
443 move->ClearPending(destination);
445 // No one else should write to the move destination when the it is pending.
446 DCHECK(!move->IsRedundant());
448 Location source = move->GetSource();
449 // The move may be blocked on several pending moves, in case we have a cycle.
459 // We only care about the move size.
460 DataType::Type type = move->Is64BitMove() ? DataType::Type::kInt64 : DataType::Type::kInt32;
462 move->SetDestination(scratch);
464 move->Eliminate();
469 // This move is not blocked.
471 move->Eliminate();
482 // We do not depend on the pending move index. So just delete the move instead
485 move->SetSource(pending_source);
486 move->SetDestination(pending_destination);
488 move->Eliminate();
496 // Only scratch overlapping with performed move source can be unblocked.
506 // (from -> to) has been performed. Since we ensure there is no move with the same
516 for (MoveOperands* move : moves_) {
517 if (move->GetSource().Equals(from)) {
518 move->SetSource(to);
529 void ParallelMoveResolverNoSwap::DeletePendingMove(MoveOperands* move) {
530 RemoveElement(pending_moves_, move);
534 for (MoveOperands* move : pending_moves_) {
535 Location destination = move->GetDestination();
538 return move;
545 for (MoveOperands* move : pending_moves_) {
546 if (move->Blocks(loc)) {
550 for (MoveOperands* move : moves_) {
551 if (move->Blocks(loc)) {