@@ -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 ,
0 commit comments