Skip to content

Commit a250e91

Browse files
committed
[AMDGPU] SIFoldOperands: make use of emplace_back. NFC.
1 parent 2724b57 commit a250e91

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Target/AMDGPU/SIFoldOperands.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ static void appendFoldCandidate(SmallVectorImpl<FoldCandidate> &FoldList,
339339
return;
340340
LLVM_DEBUG(dbgs() << "Append " << (Commuted ? "commuted" : "normal")
341341
<< " operand " << OpNo << "\n " << *MI);
342-
FoldList.push_back(FoldCandidate(MI, OpNo, FoldOp, Commuted, ShrinkOp));
342+
FoldList.emplace_back(MI, OpNo, FoldOp, Commuted, ShrinkOp);
343343
}
344344

345345
static bool tryAddToFoldList(SmallVectorImpl<FoldCandidate> &FoldList,
@@ -520,7 +520,7 @@ static bool getRegSeqInit(
520520
Sub = Op;
521521
}
522522

523-
Defs.push_back(std::make_pair(Sub, Def->getOperand(I + 1).getImm()));
523+
Defs.emplace_back(Sub, Def->getOperand(I + 1).getImm());
524524
}
525525

526526
return true;
@@ -700,9 +700,9 @@ void SIFoldOperands::foldOperand(
700700
if (Use.isImplicit())
701701
continue;
702702

703-
FoldCandidate FC = FoldCandidate(Use.getParent(), Use.getParent()->getOperandNo(&Use),
704-
&UseMI->getOperand(1));
705-
CopyUses.push_back(FC);
703+
CopyUses.emplace_back(Use.getParent(),
704+
Use.getParent()->getOperandNo(&Use),
705+
&UseMI->getOperand(1));
706706
}
707707
for (auto &F : CopyUses) {
708708
foldOperand(*F.OpToFold, F.UseMI, F.UseOpNo, FoldList, CopiesToReplace);

0 commit comments

Comments
 (0)