Skip to content

Commit df77a86

Browse files
authored
[RISCV][NFC] Rename getOppositeBranchCondition (#160972)
1 parent 1f82553 commit df77a86

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

llvm/lib/Target/RISCV/RISCVExpandPseudoInsts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ bool RISCVExpandPseudo::expandCCOp(MachineBasicBlock &MBB,
193193
// we need to invert the branch condition to jump over TrueBB when the
194194
// condition is false.
195195
auto CC = static_cast<RISCVCC::CondCode>(MI.getOperand(3).getImm());
196-
CC = RISCVCC::getOppositeBranchCondition(CC);
196+
CC = RISCVCC::getInverseBranchCondition(CC);
197197

198198
// Insert branch instruction.
199199
BuildMI(MBB, MBBI, DL, TII->get(RISCVCC::getBrCond(CC)))

llvm/lib/Target/RISCV/RISCVInstrInfo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ unsigned RISCVCC::getBrCond(RISCVCC::CondCode CC, unsigned SelectOpc) {
11341134
}
11351135
}
11361136

1137-
RISCVCC::CondCode RISCVCC::getOppositeBranchCondition(RISCVCC::CondCode CC) {
1137+
RISCVCC::CondCode RISCVCC::getInverseBranchCondition(RISCVCC::CondCode CC) {
11381138
switch (CC) {
11391139
default:
11401140
llvm_unreachable("Unrecognized conditional branch");
@@ -1554,7 +1554,7 @@ bool RISCVInstrInfo::optimizeCondBranch(MachineInstr &MI) const {
15541554
return Register();
15551555
};
15561556

1557-
unsigned NewOpc = RISCVCC::getBrCond(getOppositeBranchCondition(CC));
1557+
unsigned NewOpc = RISCVCC::getBrCond(getInverseBranchCondition(CC));
15581558

15591559
// Might be case 1.
15601560
// Don't change 0 to 1 since we can use x0.
@@ -1801,7 +1801,7 @@ RISCVInstrInfo::optimizeSelect(MachineInstr &MI,
18011801
// Add condition code, inverting if necessary.
18021802
auto CC = static_cast<RISCVCC::CondCode>(MI.getOperand(3).getImm());
18031803
if (Invert)
1804-
CC = RISCVCC::getOppositeBranchCondition(CC);
1804+
CC = RISCVCC::getInverseBranchCondition(CC);
18051805
NewMI.addImm(CC);
18061806

18071807
// Copy the false register.
@@ -3978,7 +3978,7 @@ MachineInstr *RISCVInstrInfo::commuteInstructionImpl(MachineInstr &MI,
39783978
case RISCV::PseudoCCMOVGPR: {
39793979
// CCMOV can be commuted by inverting the condition.
39803980
auto CC = static_cast<RISCVCC::CondCode>(MI.getOperand(3).getImm());
3981-
CC = RISCVCC::getOppositeBranchCondition(CC);
3981+
CC = RISCVCC::getInverseBranchCondition(CC);
39823982
auto &WorkingMI = cloneIfNew(MI);
39833983
WorkingMI.getOperand(3).setImm(CC);
39843984
return TargetInstrInfo::commuteInstructionImpl(WorkingMI, /*NewMI*/ false,

llvm/lib/Target/RISCV/RISCVInstrInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ enum CondCode {
4444
COND_INVALID
4545
};
4646

47-
CondCode getOppositeBranchCondition(CondCode);
47+
CondCode getInverseBranchCondition(CondCode);
4848
unsigned getBrCond(CondCode CC, unsigned SelectOpc = 0);
4949

5050
} // end of namespace RISCVCC

0 commit comments

Comments
 (0)