[llvm] a250e91 - [AMDGPU] SIFoldOperands: make use of emplace_back. NFC.
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 8 06:52:18 PDT 2021
Author: Jay Foad
Date: 2021-04-08T14:34:10+01:00
New Revision: a250e91d1034a53562c86451642327bb5cbc4c0b
URL: https://github.com/llvm/llvm-project/commit/a250e91d1034a53562c86451642327bb5cbc4c0b
DIFF: https://github.com/llvm/llvm-project/commit/a250e91d1034a53562c86451642327bb5cbc4c0b.diff
LOG: [AMDGPU] SIFoldOperands: make use of emplace_back. NFC.
Added:
Modified:
llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
index 7635f52d78db..a236dc156643 100644
--- a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
@@ -339,7 +339,7 @@ static void appendFoldCandidate(SmallVectorImpl<FoldCandidate> &FoldList,
return;
LLVM_DEBUG(dbgs() << "Append " << (Commuted ? "commuted" : "normal")
<< " operand " << OpNo << "\n " << *MI);
- FoldList.push_back(FoldCandidate(MI, OpNo, FoldOp, Commuted, ShrinkOp));
+ FoldList.emplace_back(MI, OpNo, FoldOp, Commuted, ShrinkOp);
}
static bool tryAddToFoldList(SmallVectorImpl<FoldCandidate> &FoldList,
@@ -520,7 +520,7 @@ static bool getRegSeqInit(
Sub = Op;
}
- Defs.push_back(std::make_pair(Sub, Def->getOperand(I + 1).getImm()));
+ Defs.emplace_back(Sub, Def->getOperand(I + 1).getImm());
}
return true;
@@ -700,9 +700,9 @@ void SIFoldOperands::foldOperand(
if (Use.isImplicit())
continue;
- FoldCandidate FC = FoldCandidate(Use.getParent(), Use.getParent()->getOperandNo(&Use),
- &UseMI->getOperand(1));
- CopyUses.push_back(FC);
+ CopyUses.emplace_back(Use.getParent(),
+ Use.getParent()->getOperandNo(&Use),
+ &UseMI->getOperand(1));
}
for (auto &F : CopyUses) {
foldOperand(*F.OpToFold, F.UseMI, F.UseOpNo, FoldList, CopiesToReplace);
More information about the llvm-commits
mailing list