diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp index 74a75a868cde..50d8eee8644c 100644 --- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp +++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp @@ -1701,7 +1701,7 @@ void ARMFrameLowering::emitPushInst(MachineBasicBlock &MBB, .addReg(ARM::SP) .setMIFlags(MachineInstr::FrameSetup) .add(predOps(ARMCC::AL)); - for (const auto [Reg, Kill] : Regs) + for (const auto &[Reg, Kill] : Regs) MIB.addReg(Reg, getKillRegState(Kill)); } else if (Regs.size() == 1) { BuildMI(MBB, MI, DL, TII.get(StrOpc), ARM::SP) diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 40ca525757ad..5bce15eceafa 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -2766,7 +2766,7 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI, // Build a sequence of copy-to-reg nodes chained together with token chain // and flag operands which copy the outgoing args into the appropriate regs. SDValue InGlue; - for (const auto [Reg, N] : RegsToPass) { + for (const auto &[Reg, N] : RegsToPass) { Chain = DAG.getCopyToReg(Chain, dl, Reg, N, InGlue); InGlue = Chain.getValue(1); } @@ -2951,7 +2951,7 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI, // Add argument registers to the end of the list so that they are known live // into the call. - for (const auto [Reg, N] : RegsToPass) + for (const auto &[Reg, N] : RegsToPass) Ops.push_back(DAG.getRegister(Reg, N.getValueType())); // Add a register mask operand representing the call-preserved registers. diff --git a/llvm/lib/Target/X86/X86ISelLoweringCall.cpp b/llvm/lib/Target/X86/X86ISelLoweringCall.cpp index edd390331631..cb38a39ff991 100644 --- a/llvm/lib/Target/X86/X86ISelLoweringCall.cpp +++ b/llvm/lib/Target/X86/X86ISelLoweringCall.cpp @@ -2421,7 +2421,7 @@ X86TargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI, // Build a sequence of copy-to-reg nodes chained together with token chain // and glue operands which copy the outgoing args into registers. SDValue InGlue; - for (const auto [Reg, N] : RegsToPass) { + for (const auto &[Reg, N] : RegsToPass) { Chain = DAG.getCopyToReg(Chain, dl, Reg, N, InGlue); InGlue = Chain.getValue(1); } @@ -2461,7 +2461,7 @@ X86TargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI, // Add argument registers to the end of the list so that they are known live // into the call. - for (const auto [Reg, N] : RegsToPass) + for (const auto &[Reg, N] : RegsToPass) Ops.push_back(DAG.getRegister(Reg, N.getValueType())); // Add a register mask operand representing the call-preserved registers.