18 changes: 9 additions & 9 deletions llvm/lib/CodeGen/MachineBasicBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ void MachineBasicBlock::updateTerminator() {
// The block has an unconditional branch. If its successor is now its
// layout successor, delete the branch.
if (isLayoutSuccessor(TBB))
TII->RemoveBranch(*this);
TII->removeBranch(*this);
} else {
// The block has an unconditional fallthrough. If its successor is not its
// layout successor, insert a branch. First we have to locate the only
Expand Down Expand Up @@ -446,12 +446,12 @@ void MachineBasicBlock::updateTerminator() {
// successors is its layout successor, rewrite it to a fallthrough
// conditional branch.
if (isLayoutSuccessor(TBB)) {
if (TII->ReverseBranchCondition(Cond))
if (TII->reverseBranchCondition(Cond))
return;
TII->RemoveBranch(*this);
TII->removeBranch(*this);
TII->insertBranch(*this, FBB, nullptr, Cond, DL);
} else if (isLayoutSuccessor(FBB)) {
TII->RemoveBranch(*this);
TII->removeBranch(*this);
TII->insertBranch(*this, TBB, nullptr, Cond, DL);
}
return;
Expand All @@ -474,7 +474,7 @@ void MachineBasicBlock::updateTerminator() {
// Remove the conditional jump, leaving unconditional fallthrough.
// FIXME: This does not seem like a reasonable pattern to support, but it
// has been seen in the wild coming out of degenerate ARM test cases.
TII->RemoveBranch(*this);
TII->removeBranch(*this);

// Finally update the unconditional successor to be reached via a branch if
// it would not be reached by fallthrough.
Expand All @@ -486,24 +486,24 @@ void MachineBasicBlock::updateTerminator() {
// We enter here iff exactly one successor is TBB which cannot fallthrough
// and the rest successors if any are EHPads. In this case, we need to
// change the conditional branch into unconditional branch.
TII->RemoveBranch(*this);
TII->removeBranch(*this);
Cond.clear();
TII->insertBranch(*this, TBB, nullptr, Cond, DL);
return;
}

// The block has a fallthrough conditional branch.
if (isLayoutSuccessor(TBB)) {
if (TII->ReverseBranchCondition(Cond)) {
if (TII->reverseBranchCondition(Cond)) {
// We can't reverse the condition, add an unconditional branch.
Cond.clear();
TII->insertBranch(*this, FallthroughBB, nullptr, Cond, DL);
return;
}
TII->RemoveBranch(*this);
TII->removeBranch(*this);
TII->insertBranch(*this, FallthroughBB, nullptr, Cond, DL);
} else if (!isLayoutSuccessor(FallthroughBB)) {
TII->RemoveBranch(*this);
TII->removeBranch(*this);
TII->insertBranch(*this, TBB, FallthroughBB, Cond, DL);
}
}
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/MachineBlockPlacement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1635,14 +1635,14 @@ void MachineBlockPlacement::optimizeBranches() {
if (TBB && !Cond.empty() && FBB &&
MBPI->getEdgeProbability(ChainBB, FBB) >
MBPI->getEdgeProbability(ChainBB, TBB) &&
!TII->ReverseBranchCondition(Cond)) {
!TII->reverseBranchCondition(Cond)) {
DEBUG(dbgs() << "Reverse order of the two branches: "
<< getBlockName(ChainBB) << "\n");
DEBUG(dbgs() << " Edge probability: "
<< MBPI->getEdgeProbability(ChainBB, FBB) << " vs "
<< MBPI->getEdgeProbability(ChainBB, TBB) << "\n");
DebugLoc dl; // FIXME: this is nowhere
TII->RemoveBranch(*ChainBB);
TII->removeBranch(*ChainBB);
TII->insertBranch(*ChainBB, FBB, TBB, Cond, dl);
ChainBB->updateTerminator();
}
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/MachinePipeliner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2363,7 +2363,7 @@ void SwingSchedulerDAG::generateProlog(SMSchedule &Schedule, unsigned LastStage,

// Check if we need to remove the branch from the preheader to the original
// loop, and replace it with a branch to the new loop.
unsigned numBranches = TII->RemoveBranch(*PreheaderBB);
unsigned numBranches = TII->removeBranch(*PreheaderBB);
if (numBranches) {
SmallVector<MachineOperand, 0> Cond;
TII->insertBranch(*PreheaderBB, PrologBBs[0], nullptr, Cond, DebugLoc());
Expand Down Expand Up @@ -2452,7 +2452,7 @@ void SwingSchedulerDAG::generateEpilog(SMSchedule &Schedule, unsigned LastStage,

// Create a branch to the new epilog from the kernel.
// Remove the original branch and add a new branch to the epilog.
TII->RemoveBranch(*KernelBB);
TII->removeBranch(*KernelBB);
TII->insertBranch(*KernelBB, KernelBB, EpilogStart, Cond, DebugLoc());
// Add a branch to the loop exit.
if (EpilogBBs.size() > 0) {
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/TailDuplicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ bool TailDuplicator::duplicateSimpleBB(
if (PredTBB == NextBB && PredFBB == nullptr)
PredTBB = nullptr;

TII->RemoveBranch(*PredBB);
TII->removeBranch(*PredBB);

if (!PredBB->isSuccessor(NewTarget))
PredBB->replaceSuccessor(TailBB, NewTarget);
Expand Down Expand Up @@ -784,7 +784,7 @@ bool TailDuplicator::tailDuplicate(bool IsSimple, MachineBasicBlock *TailBB,
TDBBs.push_back(PredBB);

// Remove PredBB's unconditional branch.
TII->RemoveBranch(*PredBB);
TII->removeBranch(*PredBB);

// Clone the contents of TailBB into PredBB.
DenseMap<unsigned, RegSubRegPair> LocalVRMap;
Expand Down
8 changes: 4 additions & 4 deletions llvm/lib/Target/AArch64/AArch64BranchRelaxation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@ bool AArch64BranchRelaxation::fixupConditionalBranch(MachineInstr &MI) {
DEBUG(dbgs() << " Invert condition and swap "
"its destination with " << MBB->back());

TII->ReverseBranchCondition(Cond);
TII->reverseBranchCondition(Cond);
int OldSize = 0, NewSize = 0;
TII->RemoveBranch(*MBB, &OldSize);
TII->removeBranch(*MBB, &OldSize);
TII->insertBranch(*MBB, FBB, TBB, Cond, DL, &NewSize);

BlockInfo[MBB->getNumber()].Size += (NewSize - OldSize);
Expand Down Expand Up @@ -340,8 +340,8 @@ bool AArch64BranchRelaxation::fixupConditionalBranch(MachineInstr &MI) {

// Insert a new conditional branch and a new unconditional branch.
int RemovedSize = 0;
TII->ReverseBranchCondition(Cond);
TII->RemoveBranch(*MBB, &RemovedSize);
TII->reverseBranchCondition(Cond);
TII->removeBranch(*MBB, &RemovedSize);
MBBSize -= RemovedSize;

int AddedSize = 0;
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AArch64/AArch64ConditionalCompares.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ void SSACCmpConv::convert(SmallVectorImpl<MachineBasicBlock *> &RemovedBlocks) {
CmpBB->removeSuccessor(Tail, true);
Head->transferSuccessorsAndUpdatePHIs(CmpBB);
DebugLoc TermDL = Head->getFirstTerminator()->getDebugLoc();
TII->RemoveBranch(*Head);
TII->removeBranch(*Head);

// If the Head terminator was one of the cbz / tbz branches with built-in
// compare, we need to insert an explicit compare instruction in its place.
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ bool AArch64InstrInfo::analyzeBranch(MachineBasicBlock &MBB,
return true;
}

bool AArch64InstrInfo::ReverseBranchCondition(
bool AArch64InstrInfo::reverseBranchCondition(
SmallVectorImpl<MachineOperand> &Cond) const {
if (Cond[0].getImm() != -1) {
// Regular Bcc
Expand Down Expand Up @@ -298,7 +298,7 @@ bool AArch64InstrInfo::ReverseBranchCondition(
return false;
}

unsigned AArch64InstrInfo::RemoveBranch(MachineBasicBlock &MBB,
unsigned AArch64InstrInfo::removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved) const {
MachineBasicBlock::iterator I = MBB.getLastNonDebugInstr();
if (I == MBB.end())
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/AArch64/AArch64InstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,14 @@ class AArch64InstrInfo final : public AArch64GenInstrInfo {
MachineBasicBlock *&FBB,
SmallVectorImpl<MachineOperand> &Cond,
bool AllowModify = false) const override;
unsigned RemoveBranch(MachineBasicBlock &MBB,
unsigned removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved = nullptr) const override;
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
const DebugLoc &DL,
int *BytesAdded = nullptr) const override;
bool
ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
bool canInsertSelect(const MachineBasicBlock &, ArrayRef<MachineOperand> Cond,
unsigned, unsigned, int &, int &, int &) const override;
void insertSelect(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/AMDGPU/R600InstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ unsigned R600InstrInfo::insertBranch(MachineBasicBlock &MBB,
}
}

unsigned R600InstrInfo::RemoveBranch(MachineBasicBlock &MBB,
unsigned R600InstrInfo::removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved) const {
assert(!BytesRemoved && "code size not handled");

Expand Down Expand Up @@ -910,7 +910,7 @@ R600InstrInfo::isProfitableToUnpredicate(MachineBasicBlock &TMBB,


bool
R600InstrInfo::ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const {
R600InstrInfo::reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const {
MachineOperand &MO = Cond[1];
switch (MO.getImm()) {
case AMDGPU::PRED_SETE_INT:
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/AMDGPU/R600InstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class R600InstrInfo final : public AMDGPUInstrInfo {
DFAPacketizer *
CreateTargetScheduleState(const TargetSubtargetInfo &) const override;

bool ReverseBranchCondition(
bool reverseBranchCondition(
SmallVectorImpl<MachineOperand> &Cond) const override;

bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
Expand All @@ -172,7 +172,7 @@ class R600InstrInfo final : public AMDGPUInstrInfo {
const DebugLoc &DL,
int *BytesAdded = nullptr) const override;

unsigned RemoveBranch(MachineBasicBlock &MBB,
unsigned removeBranch(MachineBasicBlock &MBB,
int *BytesRemvoed = nullptr) const override;

bool isPredicated(const MachineInstr &MI) const override;
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ bool SIInstrInfo::analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
return true;
}

unsigned SIInstrInfo::RemoveBranch(MachineBasicBlock &MBB,
unsigned SIInstrInfo::removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved) const {
MachineBasicBlock::iterator I = MBB.getFirstTerminator();

Expand Down Expand Up @@ -1167,7 +1167,7 @@ unsigned SIInstrInfo::insertBranch(MachineBasicBlock &MBB,
return 2;
}

bool SIInstrInfo::ReverseBranchCondition(
bool SIInstrInfo::reverseBranchCondition(
SmallVectorImpl<MachineOperand> &Cond) const {
assert(Cond.size() == 1);
Cond[0].setImm(-Cond[0].getImm());
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/AMDGPU/SIInstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ class SIInstrInfo final : public AMDGPUInstrInfo {
SmallVectorImpl<MachineOperand> &Cond,
bool AllowModify) const override;

unsigned RemoveBranch(MachineBasicBlock &MBB,
unsigned removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved = nullptr) const override;

unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
const DebugLoc &DL,
int *BytesAdded = nullptr) const override;

bool ReverseBranchCondition(
bool reverseBranchCondition(
SmallVectorImpl<MachineOperand> &Cond) const override;

bool
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ bool ARMBaseInstrInfo::analyzeBranch(MachineBasicBlock &MBB,
}


unsigned ARMBaseInstrInfo::RemoveBranch(MachineBasicBlock &MBB,
unsigned ARMBaseInstrInfo::removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved) const {
assert(!BytesRemoved && "code size not handled");

Expand Down Expand Up @@ -453,7 +453,7 @@ unsigned ARMBaseInstrInfo::insertBranch(MachineBasicBlock &MBB,
}

bool ARMBaseInstrInfo::
ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const {
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const {
ARMCC::CondCodes CC = (ARMCC::CondCodes)(int)Cond[0].getImm();
Cond[0].setImm(ARMCC::getOppositeCondition(CC));
return false;
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/ARM/ARMBaseInstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ class ARMBaseInstrInfo : public ARMGenInstrInfo {
MachineBasicBlock *&FBB,
SmallVectorImpl<MachineOperand> &Cond,
bool AllowModify = false) const override;
unsigned RemoveBranch(MachineBasicBlock &MBB,
unsigned removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved = nullptr) const override;
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
const DebugLoc &DL,
int *BytesAdded = nullptr) const override;

bool
ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;

// Predication support.
bool isPredicated(const MachineInstr &MI) const override;
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/AVR/AVRInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ unsigned AVRInstrInfo::insertBranch(MachineBasicBlock &MBB,
return Count;
}

unsigned AVRInstrInfo::RemoveBranch(MachineBasicBlock &MBB,
unsigned AVRInstrInfo::removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved) const {
assert(!BytesRemoved && "code size not handled");

Expand Down Expand Up @@ -435,7 +435,7 @@ unsigned AVRInstrInfo::RemoveBranch(MachineBasicBlock &MBB,
return Count;
}

bool AVRInstrInfo::ReverseBranchCondition(
bool AVRInstrInfo::reverseBranchCondition(
SmallVectorImpl<MachineOperand> &Cond) const {
assert(Cond.size() == 1 && "Invalid AVR branch condition!");

Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/AVR/AVRInstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ class AVRInstrInfo : public AVRGenInstrInfo {
MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
const DebugLoc &DL,
int *BytesAdded = nullptr) const override;
unsigned RemoveBranch(MachineBasicBlock &MBB,
unsigned removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved = nullptr) const override;
bool
ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;

private:
const AVRRegisterInfo RI;
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/BPF/BPFInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ unsigned BPFInstrInfo::insertBranch(MachineBasicBlock &MBB,
llvm_unreachable("Unexpected conditional branch");
}

unsigned BPFInstrInfo::RemoveBranch(MachineBasicBlock &MBB,
unsigned BPFInstrInfo::removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved) const {
assert(!BytesRemoved && "code size not handled");

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/BPF/BPFInstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class BPFInstrInfo : public BPFGenInstrInfo {
SmallVectorImpl<MachineOperand> &Cond,
bool AllowModify) const override;

unsigned RemoveBranch(MachineBasicBlock &MBB,
unsigned removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved = nullptr) const override;
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ void HexagonEarlyIfConversion::mergeBlocks(MachineBasicBlock *PredB,
<< PrintMB(SuccB) << "\n");
bool TermOk = hasUncondBranch(SuccB);
eliminatePhis(SuccB);
HII->RemoveBranch(*PredB);
HII->removeBranch(*PredB);
PredB->removeSuccessor(SuccB);
PredB->splice(PredB->end(), SuccB, SuccB->begin(), SuccB->end());
MachineBasicBlock::succ_iterator I, E = SuccB->succ_end();
Expand Down
10 changes: 5 additions & 5 deletions llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ bool HexagonInstrInfo::analyzeBranch(MachineBasicBlock &MBB,
}


unsigned HexagonInstrInfo::RemoveBranch(MachineBasicBlock &MBB,
unsigned HexagonInstrInfo::removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved) const {
assert(!BytesRemoved && "code size not handled");

Expand Down Expand Up @@ -572,7 +572,7 @@ unsigned HexagonInstrInfo::insertBranch(MachineBasicBlock &MBB,
assert(TBB && "insertBranch must not be told to insert a fallthrough");
assert(!BytesAdded && "code size not handled");

// Check if ReverseBranchCondition has asked to reverse this branch
// Check if reverseBranchCondition has asked to reverse this branch
// If we want to reverse the branch an odd number of times, we want
// J2_jumpf.
if (!Cond.empty() && Cond[0].isImm())
Expand All @@ -590,8 +590,8 @@ unsigned HexagonInstrInfo::insertBranch(MachineBasicBlock &MBB,
if (Term != MBB.end() && isPredicated(*Term) &&
!analyzeBranch(MBB, NewTBB, NewFBB, Cond, false) &&
MachineFunction::iterator(NewTBB) == ++MBB.getIterator()) {
ReverseBranchCondition(Cond);
RemoveBranch(MBB);
reverseBranchCondition(Cond);
removeBranch(MBB);
return insertBranch(MBB, TBB, nullptr, Cond, DL);
}
BuildMI(&MBB, DL, get(BOpc)).addMBB(TBB);
Expand Down Expand Up @@ -1360,7 +1360,7 @@ bool HexagonInstrInfo::expandPostRAPseudo(MachineInstr &MI) const {

// We indicate that we want to reverse the branch by
// inserting the reversed branching opcode.
bool HexagonInstrInfo::ReverseBranchCondition(
bool HexagonInstrInfo::reverseBranchCondition(
SmallVectorImpl<MachineOperand> &Cond) const {
if (Cond.empty())
return true;
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Target/Hexagon/HexagonInstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class HexagonInstrInfo : public HexagonGenInstrInfo {
/// condition. These operands can be passed to other TargetInstrInfo
/// methods to create new branches.
///
/// Note that RemoveBranch and insertBranch must be implemented to support
/// Note that removeBranch and insertBranch must be implemented to support
/// cases where this method returns success.
///
/// If AllowModify is true, then this routine is allowed to modify the basic
Expand All @@ -87,7 +87,7 @@ class HexagonInstrInfo : public HexagonGenInstrInfo {
/// Remove the branching code at the end of the specific MBB.
/// This is only invoked in cases where AnalyzeBranch returns success. It
/// returns the number of instructions that were removed.
unsigned RemoveBranch(MachineBasicBlock &MBB,
unsigned removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved = nullptr) const override;

/// Insert branch code into the end of the specified MachineBasicBlock.
Expand Down Expand Up @@ -197,7 +197,7 @@ class HexagonInstrInfo : public HexagonGenInstrInfo {

/// Reverses the branch condition of the specified condition list,
/// returning false on success and true if it cannot be reversed.
bool ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond)
bool reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond)
const override;

/// Insert a noop into the instruction stream at the specified point.
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Target/Lanai/LanaiInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -641,10 +641,10 @@ bool LanaiInstrInfo::analyzeBranch(MachineBasicBlock &MBB,
return false;
}

// ReverseBranchCondition - Reverses the branch condition of the specified
// reverseBranchCondition - Reverses the branch condition of the specified
// condition list, returning false on success and true if it cannot be
// reversed.
bool LanaiInstrInfo::ReverseBranchCondition(
bool LanaiInstrInfo::reverseBranchCondition(
SmallVectorImpl<llvm::MachineOperand> &Condition) const {
assert((Condition.size() == 1) &&
"Lanai branch conditions should have one component.");
Expand Down Expand Up @@ -690,7 +690,7 @@ unsigned LanaiInstrInfo::insertBranch(MachineBasicBlock &MBB,
return 2;
}

unsigned LanaiInstrInfo::RemoveBranch(MachineBasicBlock &MBB,
unsigned LanaiInstrInfo::removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved) const {
assert(!BytesRemoved && "code size not handled");

Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/Lanai/LanaiInstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class LanaiInstrInfo : public LanaiGenInstrInfo {
SmallVectorImpl<MachineOperand> &Condition,
bool AllowModify) const override;

unsigned RemoveBranch(MachineBasicBlock &MBB,
unsigned removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved = nullptr) const override;

// For a comparison instruction, return the source registers in SrcReg and
Expand Down Expand Up @@ -130,7 +130,7 @@ class LanaiInstrInfo : public LanaiGenInstrInfo {
SmallPtrSetImpl<MachineInstr *> &SeenMIs,
bool PreferFalse) const override;

bool ReverseBranchCondition(
bool reverseBranchCondition(
SmallVectorImpl<MachineOperand> &Condition) const override;

unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TrueBlock,
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/MSP430/MSP430BranchSelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ bool MSP430BSel::runOnMachineFunction(MachineFunction &Fn) {
Cond.push_back(I->getOperand(1));

// Jump over the uncond branch inst (i.e. $+6) on opposite condition.
TII->ReverseBranchCondition(Cond);
TII->reverseBranchCondition(Cond);
BuildMI(MBB, I, dl, TII->get(MSP430::JCC))
.addImm(4).addOperand(Cond[0]);

Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/MSP430/MSP430InstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void MSP430InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
.addReg(SrcReg, getKillRegState(KillSrc));
}

unsigned MSP430InstrInfo::RemoveBranch(MachineBasicBlock &MBB,
unsigned MSP430InstrInfo::removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved) const {
assert(!BytesRemoved && "code size not handled");

Expand All @@ -130,7 +130,7 @@ unsigned MSP430InstrInfo::RemoveBranch(MachineBasicBlock &MBB,
}

bool MSP430InstrInfo::
ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const {
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const {
assert(Cond.size() == 1 && "Invalid Xbranch condition!");

MSP430CC::CondCodes CC = static_cast<MSP430CC::CondCodes>(Cond[0].getImm());
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/MSP430/MSP430InstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ class MSP430InstrInfo : public MSP430GenInstrInfo {

// Branch folding goodness
bool
ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
bool isUnpredicatedTerminator(const MachineInstr &MI) const override;
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
MachineBasicBlock *&FBB,
SmallVectorImpl<MachineOperand> &Cond,
bool AllowModify) const override;

unsigned RemoveBranch(MachineBasicBlock &MBB,
unsigned removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved = nullptr) const override;
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Target/Mips/MipsInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ unsigned MipsInstrInfo::insertBranch(MachineBasicBlock &MBB,
return 1;
}

unsigned MipsInstrInfo::RemoveBranch(MachineBasicBlock &MBB,
unsigned MipsInstrInfo::removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved) const {
assert(!BytesRemoved && "code size not handled");

Expand All @@ -174,9 +174,9 @@ unsigned MipsInstrInfo::RemoveBranch(MachineBasicBlock &MBB,
return removed;
}

/// ReverseBranchCondition - Return the inverse opcode of the
/// reverseBranchCondition - Return the inverse opcode of the
/// specified Branch instruction.
bool MipsInstrInfo::ReverseBranchCondition(
bool MipsInstrInfo::reverseBranchCondition(
SmallVectorImpl<MachineOperand> &Cond) const {
assert( (Cond.size() && Cond.size() <= 3) &&
"Invalid Mips branch condition!");
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/Mips/MipsInstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class MipsInstrInfo : public MipsGenInstrInfo {
SmallVectorImpl<MachineOperand> &Cond,
bool AllowModify) const override;

unsigned RemoveBranch(MachineBasicBlock &MBB,
unsigned removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved = nullptr) const override;

unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
Expand All @@ -64,7 +64,7 @@ class MipsInstrInfo : public MipsGenInstrInfo {
int *BytesAdded = nullptr) const override;

bool
ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;

BranchType analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
MachineBasicBlock *&FBB,
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/NVPTX/NVPTXInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ bool NVPTXInstrInfo::CanTailMerge(const MachineInstr *MI) const {
/// operands can be passed to other TargetInstrInfo methods to create new
/// branches.
///
/// Note that RemoveBranch and insertBranch must be implemented to support
/// Note that removeBranch and insertBranch must be implemented to support
/// cases where this method returns success.
///
bool NVPTXInstrInfo::analyzeBranch(MachineBasicBlock &MBB,
Expand Down Expand Up @@ -205,7 +205,7 @@ bool NVPTXInstrInfo::analyzeBranch(MachineBasicBlock &MBB,
return true;
}

unsigned NVPTXInstrInfo::RemoveBranch(MachineBasicBlock &MBB,
unsigned NVPTXInstrInfo::removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved) const {
assert(!BytesRemoved && "code size not handled");
MachineBasicBlock::iterator I = MBB.end();
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/NVPTX/NVPTXInstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class NVPTXInstrInfo : public NVPTXGenInstrInfo {
MachineBasicBlock *&FBB,
SmallVectorImpl<MachineOperand> &Cond,
bool AllowModify) const override;
unsigned RemoveBranch(MachineBasicBlock &MBB,
unsigned removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved = nullptr) const override;
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ bool PPCInstrInfo::analyzeBranch(MachineBasicBlock &MBB,
return true;
}

unsigned PPCInstrInfo::RemoveBranch(MachineBasicBlock &MBB,
unsigned PPCInstrInfo::removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved) const {
assert(!BytesRemoved && "code size not handled");

Expand Down Expand Up @@ -1204,7 +1204,7 @@ PPCInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
}

bool PPCInstrInfo::
ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const {
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const {
assert(Cond.size() == 2 && "Invalid PPC branch opcode!");
if (Cond[1].getReg() == PPC::CTR8 || Cond[1].getReg() == PPC::CTR)
Cond[0].setImm(Cond[0].getImm() == 0 ? 1 : 0);
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/PowerPC/PPCInstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class PPCInstrInfo : public PPCGenInstrInfo {
MachineBasicBlock *&FBB,
SmallVectorImpl<MachineOperand> &Cond,
bool AllowModify) const override;
unsigned RemoveBranch(MachineBasicBlock &MBB,
unsigned removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved = nullptr) const override;
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
Expand Down Expand Up @@ -200,7 +200,7 @@ class PPCInstrInfo : public PPCGenInstrInfo {
const TargetRegisterInfo *TRI) const override;

bool
ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;

bool FoldImmediate(MachineInstr &UseMI, MachineInstr &DefMI, unsigned Reg,
MachineRegisterInfo *MRI) const override;
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/Sparc/SparcInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ unsigned SparcInstrInfo::insertBranch(MachineBasicBlock &MBB,
return 2;
}

unsigned SparcInstrInfo::RemoveBranch(MachineBasicBlock &MBB,
unsigned SparcInstrInfo::removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved) const {
assert(!BytesRemoved && "code size not handled");

Expand All @@ -295,7 +295,7 @@ unsigned SparcInstrInfo::RemoveBranch(MachineBasicBlock &MBB,
return Count;
}

bool SparcInstrInfo::ReverseBranchCondition(
bool SparcInstrInfo::reverseBranchCondition(
SmallVectorImpl<MachineOperand> &Cond) const {
assert(Cond.size() == 1);
SPCC::CondCodes CC = static_cast<SPCC::CondCodes>(Cond[0].getImm());
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/Sparc/SparcInstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class SparcInstrInfo : public SparcGenInstrInfo {
SmallVectorImpl<MachineOperand> &Cond,
bool AllowModify = false) const override;

unsigned RemoveBranch(MachineBasicBlock &MBB,
unsigned removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved = nullptr) const override;

unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
Expand All @@ -79,7 +79,7 @@ class SparcInstrInfo : public SparcGenInstrInfo {
int *BytesAdded = nullptr) const override;

bool
ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;

void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg,
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ bool SystemZInstrInfo::analyzeBranch(MachineBasicBlock &MBB,
return false;
}

unsigned SystemZInstrInfo::RemoveBranch(MachineBasicBlock &MBB,
unsigned SystemZInstrInfo::removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved) const {
assert(!BytesRemoved && "code size not handled");

Expand All @@ -389,7 +389,7 @@ unsigned SystemZInstrInfo::RemoveBranch(MachineBasicBlock &MBB,
}

bool SystemZInstrInfo::
ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const {
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const {
assert(Cond.size() == 2 && "Invalid condition");
Cond[1].setImm(Cond[1].getImm() ^ Cond[0].getImm());
return false;
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/SystemZ/SystemZInstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class SystemZInstrInfo : public SystemZGenInstrInfo {
MachineBasicBlock *&FBB,
SmallVectorImpl<MachineOperand> &Cond,
bool AllowModify) const override;
unsigned RemoveBranch(MachineBasicBlock &MBB,
unsigned removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved = nullptr) const override;
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
Expand Down Expand Up @@ -214,7 +214,7 @@ class SystemZInstrInfo : public SystemZGenInstrInfo {
MachineBasicBlock::iterator InsertPt, MachineInstr &LoadMI,
LiveIntervals *LIS = nullptr) const override;
bool expandPostRAPseudo(MachineInstr &MBBI) const override;
bool ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const
bool reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const
override;

// Return the SystemZRegisterInfo, which this class owns.
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ bool WebAssemblyInstrInfo::analyzeBranch(MachineBasicBlock &MBB,
return false;
}

unsigned WebAssemblyInstrInfo::RemoveBranch(MachineBasicBlock &MBB,
unsigned WebAssemblyInstrInfo::removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved) const {
assert(!BytesRemoved && "code size not handled");

Expand Down Expand Up @@ -196,7 +196,7 @@ unsigned WebAssemblyInstrInfo::insertBranch(MachineBasicBlock &MBB,
return 2;
}

bool WebAssemblyInstrInfo::ReverseBranchCondition(
bool WebAssemblyInstrInfo::reverseBranchCondition(
SmallVectorImpl<MachineOperand> &Cond) const {
assert(Cond.size() == 2 && "Expected a flag and a successor block");
Cond.front() = MachineOperand::CreateImm(!Cond.front().getImm());
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ class WebAssemblyInstrInfo final : public WebAssemblyGenInstrInfo {
MachineBasicBlock *&FBB,
SmallVectorImpl<MachineOperand> &Cond,
bool AllowModify = false) const override;
unsigned RemoveBranch(MachineBasicBlock &MBB,
unsigned removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved = nullptr) const override;
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
const DebugLoc &DL,
int *BytesAdded = nullptr) const override;
bool
ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
};

} // end namespace llvm
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/X86/X86InstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4441,7 +4441,7 @@ bool X86InstrInfo::analyzeBranchPredicate(MachineBasicBlock &MBB,
return true;
}

unsigned X86InstrInfo::RemoveBranch(MachineBasicBlock &MBB,
unsigned X86InstrInfo::removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved) const {
assert(!BytesRemoved && "code size not handled");

Expand Down Expand Up @@ -7276,7 +7276,7 @@ bool X86InstrInfo::shouldScheduleAdjacent(MachineInstr &First,
}

bool X86InstrInfo::
ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const {
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const {
assert(Cond.size() == 1 && "Invalid X86 branch condition!");
X86::CondCode CC = static_cast<X86::CondCode>(Cond[0].getImm());
Cond[0].setImm(GetOppositeBranchCondition(CC));
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/X86/X86InstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class X86InstrInfo final : public X86GenInstrInfo {
TargetInstrInfo::MachineBranchPredicate &MBP,
bool AllowModify = false) const override;

unsigned RemoveBranch(MachineBasicBlock &MBB,
unsigned removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved = nullptr) const override;
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
Expand Down Expand Up @@ -445,7 +445,7 @@ class X86InstrInfo final : public X86GenInstrInfo {
void getNoopForMachoTarget(MCInst &NopInst) const override;

bool
ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;

/// isSafeToMoveRegClassDefs - Return true if it's safe to move a machine
/// instruction that defines the specified register class.
Expand Down
10 changes: 4 additions & 6 deletions llvm/lib/Target/XCore/XCoreInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static inline XCore::CondCode GetOppositeBranchCondition(XCore::CondCode CC)
/// operands can be passed to other TargetInstrInfo methods to create new
/// branches.
///
/// Note that RemoveBranch and insertBranch must be implemented to support
/// Note that removeBranch and insertBranch must be implemented to support
/// cases where this method returns success.
///
bool XCoreInstrInfo::analyzeBranch(MachineBasicBlock &MBB,
Expand Down Expand Up @@ -304,7 +304,7 @@ unsigned XCoreInstrInfo::insertBranch(MachineBasicBlock &MBB,
}

unsigned
XCoreInstrInfo::RemoveBranch(MachineBasicBlock &MBB, int *BytesRemoved) const {
XCoreInstrInfo::removeBranch(MachineBasicBlock &MBB, int *BytesRemoved) const {
assert(!BytesRemoved && "code size not handled");

MachineBasicBlock::iterator I = MBB.getLastNonDebugInstr();
Expand Down Expand Up @@ -400,11 +400,9 @@ void XCoreInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
.addMemOperand(MMO);
}

/// ReverseBranchCondition - Return the inverse opcode of the
/// specified Branch instruction.
bool XCoreInstrInfo::
ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const {
assert((Cond.size() == 2) &&
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const {
assert((Cond.size() == 2) &&
"Invalid XCore branch condition!");
Cond[0].setImm(GetOppositeBranchCondition((XCore::CondCode)Cond[0].getImm()));
return false;
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/XCore/XCoreInstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class XCoreInstrInfo : public XCoreGenInstrInfo {
const DebugLoc &DL,
int *BytesAdded = nullptr) const override;

unsigned RemoveBranch(MachineBasicBlock &MBB,
unsigned removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved = nullptr) const override;

void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
Expand All @@ -79,7 +79,7 @@ class XCoreInstrInfo : public XCoreGenInstrInfo {
const TargetRegisterClass *RC,
const TargetRegisterInfo *TRI) const override;

bool ReverseBranchCondition(
bool reverseBranchCondition(
SmallVectorImpl<MachineOperand> &Cond) const override;

// Emit code before MBBI to load immediate value into physical register Reg.
Expand Down