Skip to content

Commit

Permalink
[AMDGPU] SIFoldOperands: make use of emplace_back. NFC.
Browse files Browse the repository at this point in the history
  • Loading branch information
jayfoad committed Apr 8, 2021
1 parent 2724b57 commit a250e91
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a250e91

Please sign in to comment.