Skip to content

Commit d93577d

Browse files
committed
Address review comments
1 parent 903533a commit d93577d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

llvm/lib/CodeGen/MachineSink.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ namespace {
211211
private:
212212
bool ProcessBlock(MachineBasicBlock &MBB);
213213
void ProcessDbgInst(MachineInstr &MI);
214-
bool isLegalBreakingCriticalEdge(MachineInstr &MI, MachineBasicBlock *From,
215-
MachineBasicBlock *To, bool BreakPHIEdge);
214+
bool isLegalToBreakCriticalEdge(MachineInstr &MI, MachineBasicBlock *From,
215+
MachineBasicBlock *To, bool BreakPHIEdge);
216216
bool isWorthBreakingCriticalEdge(MachineInstr &MI, MachineBasicBlock *From,
217217
MachineBasicBlock *To,
218218
MachineBasicBlock *&DeferredFromBlock);
@@ -910,11 +910,11 @@ bool MachineSinking::isWorthBreakingCriticalEdge(
910910
continue;
911911
Register SrcReg = Reg.isVirtual() ? TRI->lookThruCopyLike(Reg, MRI) : Reg;
912912
auto Key = std::make_pair(SrcReg, To);
913-
auto Res = CEMergeCandidates.insert(std::make_pair(Key, From));
913+
auto Res = CEMergeCandidates.try_emplace(Key, From);
914914
// We wanted to sink the same register into the same block, consider it to
915915
// be profitable.
916916
if (!Res.second) {
917-
// Return the source block that was previously holded off.
917+
// Return the source block that was previously held off.
918918
DeferredFromBlock = Res.first->second;
919919
return true;
920920
}
@@ -954,10 +954,10 @@ bool MachineSinking::isWorthBreakingCriticalEdge(
954954
return false;
955955
}
956956

957-
bool MachineSinking::isLegalBreakingCriticalEdge(MachineInstr &MI,
958-
MachineBasicBlock *FromBB,
959-
MachineBasicBlock *ToBB,
960-
bool BreakPHIEdge) {
957+
bool MachineSinking::isLegalToBreakCriticalEdge(MachineInstr &MI,
958+
MachineBasicBlock *FromBB,
959+
MachineBasicBlock *ToBB,
960+
bool BreakPHIEdge) {
961961
// Avoid breaking back edge. From == To means backedge for single BB cycle.
962962
if (!SplitEdges || FromBB == ToBB)
963963
return false;
@@ -1029,8 +1029,8 @@ bool MachineSinking::PostponeSplitCriticalEdge(MachineInstr &MI,
10291029
// of them are legal to split.
10301030
if ((!DeferredFromBB ||
10311031
ToSplit.count(std::make_pair(DeferredFromBB, ToBB)) ||
1032-
isLegalBreakingCriticalEdge(MI, DeferredFromBB, ToBB, BreakPHIEdge)) &&
1033-
isLegalBreakingCriticalEdge(MI, FromBB, ToBB, BreakPHIEdge)) {
1032+
isLegalToBreakCriticalEdge(MI, DeferredFromBB, ToBB, BreakPHIEdge)) &&
1033+
isLegalToBreakCriticalEdge(MI, FromBB, ToBB, BreakPHIEdge)) {
10341034
ToSplit.insert(std::make_pair(FromBB, ToBB));
10351035
if (DeferredFromBB)
10361036
ToSplit.insert(std::make_pair(DeferredFromBB, ToBB));

0 commit comments

Comments
 (0)