aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorMircea Trofin <mtrofin@google.com>2021-12-06 17:33:13 -0800
committerMircea Trofin <mtrofin@google.com>2021-12-06 19:42:19 -0800
commit2bd7384d3a99edd345fcc5e8ee8d550bd65dddb2 (patch)
treed0675e898270e4d0dd02990730070f281614ca5b /llvm/lib/CodeGen/MachineFunction.cpp
parent02095f2dd7d96768432af8a53e2d743e881e7447 (diff)
downloadllvm-2bd7384d3a99edd345fcc5e8ee8d550bd65dddb2.zip
llvm-2bd7384d3a99edd345fcc5e8ee8d550bd65dddb2.tar.gz
llvm-2bd7384d3a99edd345fcc5e8ee8d550bd65dddb2.tar.bz2
[NFC][MachineInstr] Pass-by-value DebugLoc in CreateMachineInstr
DebugLoc is cheap to move, passing it by-val rather than const ref to take advantage of the fact that it is consumed that way by the MachineInstr ctor, which creates some optimization oportunities. Differential Revision: https://reviews.llvm.org/D115208
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index b6f1a6e..c249dd8 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -350,10 +350,10 @@ void MachineFunction::assignBeginEndSections() {
/// Allocate a new MachineInstr. Use this instead of `new MachineInstr'.
MachineInstr *MachineFunction::CreateMachineInstr(const MCInstrDesc &MCID,
- const DebugLoc &DL,
+ DebugLoc DL,
bool NoImplicit) {
return new (InstructionRecycler.Allocate<MachineInstr>(Allocator))
- MachineInstr(*this, MCID, DL, NoImplicit);
+ MachineInstr(*this, MCID, std::move(DL), NoImplicit);
}
/// Create a new MachineInstr which is a copy of the 'Orig' instruction,