diff options
author | abhishek-kaushik22 <abhishek.kaushik@intel.com> | 2024-11-21 16:07:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-21 13:37:56 +0530 |
commit | 46f43b6d92e49b80df13e8a537a95767ffbaac9f (patch) | |
tree | b302b3bc1f19f60acb9f3da52cb5853da1c86301 | |
parent | abb9f9fa06ef22be2b0287b9047d5cfed71d91d4 (diff) | |
download | llvm-46f43b6d92e49b80df13e8a537a95767ffbaac9f.zip llvm-46f43b6d92e49b80df13e8a537a95767ffbaac9f.tar.gz llvm-46f43b6d92e49b80df13e8a537a95767ffbaac9f.tar.bz2 |
[DebugInfo][InstrRef][MIR][GlobalIsel][MachineLICM] NFC Use std::move to avoid copying (#116935)
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MIRPrinter.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MachineLICM.cpp | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp b/llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp index a700d86..827da6a 100644 --- a/llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp +++ b/llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp @@ -537,7 +537,7 @@ void GISelKnownBits::computeKnownBitsImpl(Register R, KnownBits &Known, computeKnownBitsImpl(SrcReg, SrcOpKnown, SubDemandedElts, Depth + 1); if (SrcTy.isVector()) - Known = SrcOpKnown; + Known = std::move(SrcOpKnown); else Known = SrcOpKnown.extractBits(BitWidth, BitWidth * DstIdx); break; diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp index a9d28a3..748dd0c 100644 --- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp @@ -2927,7 +2927,7 @@ std::optional<ValueIDNum> InstrRefBasedLDV::pickOperandPHILoc( SmallVector<LocIdx, 4> NewCandidates; std::set_intersection(CandidateLocs.begin(), CandidateLocs.end(), LocVec.begin(), LocVec.end(), std::inserter(NewCandidates, NewCandidates.begin())); - CandidateLocs = NewCandidates; + CandidateLocs = std::move(NewCandidates); } if (CandidateLocs.empty()) return std::nullopt; diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp index 658bbe0..c8f6341 100644 --- a/llvm/lib/CodeGen/MIRPrinter.cpp +++ b/llvm/lib/CodeGen/MIRPrinter.cpp @@ -345,7 +345,7 @@ void MIRPrinter::convert(yaml::MachineFunction &YamlMF, if (PreferredReg) printRegMIR(PreferredReg, VReg.PreferredRegister, TRI); printRegFlags(Reg, VReg.RegisterFlags, MF, TRI); - YamlMF.VirtualRegisters.push_back(VReg); + YamlMF.VirtualRegisters.push_back(std::move(VReg)); } // Print the live ins. @@ -354,7 +354,7 @@ void MIRPrinter::convert(yaml::MachineFunction &YamlMF, printRegMIR(LI.first, LiveIn.Register, TRI); if (LI.second) printRegMIR(LI.second, LiveIn.VirtualRegister, TRI); - YamlMF.LiveIns.push_back(LiveIn); + YamlMF.LiveIns.push_back(std::move(LiveIn)); } // Prints the callee saved registers. @@ -364,9 +364,9 @@ void MIRPrinter::convert(yaml::MachineFunction &YamlMF, for (const MCPhysReg *I = CalleeSavedRegs; *I; ++I) { yaml::FlowStringValue Reg; printRegMIR(*I, Reg, TRI); - CalleeSavedRegisters.push_back(Reg); + CalleeSavedRegisters.push_back(std::move(Reg)); } - YamlMF.CalleeSavedRegisters = CalleeSavedRegisters; + YamlMF.CalleeSavedRegisters = std::move(CalleeSavedRegisters); } } diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp index 48c901b..94cbbf78 100644 --- a/llvm/lib/CodeGen/MachineLICM.cpp +++ b/llvm/lib/CodeGen/MachineLICM.cpp @@ -151,7 +151,7 @@ namespace { if (Inserted) { SmallVector<MachineBasicBlock *, 8> ExitBlocks; CurLoop->getExitBlocks(ExitBlocks); - It->second = ExitBlocks; + It->second = std::move(ExitBlocks); } return is_contained(It->second, MBB); } |