Skip to content

Commit 4fd5614

Browse files
committed
[X86] needCarryOrOverflowFlag/onlyZeroFlagUsed - merge identical switch cases. NFCI.
Makes it easier to grok and fixes various bugprone-branch-clone warnings.
1 parent 5fa2416 commit 4fd5614

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52398,8 +52398,6 @@ static bool needCarryOrOverflowFlag(SDValue Flags) {
5239852398
CC = (X86::CondCode)User->getConstantOperandVal(0);
5239952399
break;
5240052400
case X86ISD::BRCOND:
52401-
CC = (X86::CondCode)User->getConstantOperandVal(2);
52402-
break;
5240352401
case X86ISD::CMOV:
5240452402
CC = (X86::CondCode)User->getConstantOperandVal(2);
5240552403
break;
@@ -52428,10 +52426,14 @@ static bool onlyZeroFlagUsed(SDValue Flags) {
5242852426
default:
5242952427
// Be conservative.
5243052428
return false;
52431-
case X86ISD::SETCC: CCOpNo = 0; break;
52432-
case X86ISD::SETCC_CARRY: CCOpNo = 0; break;
52433-
case X86ISD::BRCOND: CCOpNo = 2; break;
52434-
case X86ISD::CMOV: CCOpNo = 2; break;
52429+
case X86ISD::SETCC:
52430+
case X86ISD::SETCC_CARRY:
52431+
CCOpNo = 0;
52432+
break;
52433+
case X86ISD::BRCOND:
52434+
case X86ISD::CMOV:
52435+
CCOpNo = 2;
52436+
break;
5243552437
}
5243652438

5243752439
X86::CondCode CC = (X86::CondCode)User->getConstantOperandVal(CCOpNo);

0 commit comments

Comments
 (0)