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