Commit ee29e419 authored by Darshan Sen's avatar Darshan Sen Committed by V8 LUCI CQ

[compiler] Prevent extra copies of RpoNumber

This fixes the following compiler warning:

```
src/compiler/backend/mid-tier-register-allocator.cc:2046:26: warning: loop variable 'succ' of type 'const
      v8::internal::compiler::RpoNumber' creates a copy from type 'const v8::internal::compiler::RpoNumber'
      [-Wrange-loop-analysis]
    for (const RpoNumber succ : block->successors()) {
                         ^
src/compiler/backend/mid-tier-register-allocator.cc:2046:10: note: use reference type 'const
      v8::internal::compiler::RpoNumber &' to prevent copying
    for (const RpoNumber succ : block->successors()) {
         ^~~~~~~~~~~~~~~~~~~~~~
                         &
```
Signed-off-by: 's avatarDarshan Sen <raisinten@gmail.com>
Change-Id: I41a9b6aa1ee16bf140f326410ae864b425509c2d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3538285Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79616}
parent 567fc462
...@@ -2043,7 +2043,7 @@ void SinglePassRegisterAllocator::EmitGapMoveFromOutput(InstructionOperand from, ...@@ -2043,7 +2043,7 @@ void SinglePassRegisterAllocator::EmitGapMoveFromOutput(InstructionOperand from,
DCHECK_EQ(data_->GetBlock(instr_index), block); DCHECK_EQ(data_->GetBlock(instr_index), block);
if (instr_index == block->last_instruction_index()) { if (instr_index == block->last_instruction_index()) {
// Add gap move to the first instruction of every successor block. // Add gap move to the first instruction of every successor block.
for (const RpoNumber succ : block->successors()) { for (const RpoNumber& succ : block->successors()) {
const InstructionBlock* successor = data_->GetBlock(succ); const InstructionBlock* successor = data_->GetBlock(succ);
DCHECK_EQ(1, successor->PredecessorCount()); DCHECK_EQ(1, successor->PredecessorCount());
data_->AddGapMove(successor->first_instruction_index(), data_->AddGapMove(successor->first_instruction_index(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment