[llvm] 4fd5614 - [X86] needCarryOrOverflowFlag/onlyZeroFlagUsed - merge identical switch cases. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 15 02:40:31 PDT 2022
Author: Simon Pilgrim
Date: 2022-06-15T10:40:22+01:00
New Revision: 4fd561415e6a62eaeffa74edac53a2f1167ccbb4
URL: https://github.com/llvm/llvm-project/commit/4fd561415e6a62eaeffa74edac53a2f1167ccbb4
DIFF: https://github.com/llvm/llvm-project/commit/4fd561415e6a62eaeffa74edac53a2f1167ccbb4.diff
LOG: [X86] needCarryOrOverflowFlag/onlyZeroFlagUsed - merge identical switch cases. NFCI.
Makes it easier to grok and fixes various bugprone-branch-clone warnings.
Added:
Modified:
llvm/lib/Target/X86/X86ISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 6f3cba40d46f..8474f9001951 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -52398,8 +52398,6 @@ static bool needCarryOrOverflowFlag(SDValue Flags) {
CC = (X86::CondCode)User->getConstantOperandVal(0);
break;
case X86ISD::BRCOND:
- CC = (X86::CondCode)User->getConstantOperandVal(2);
- break;
case X86ISD::CMOV:
CC = (X86::CondCode)User->getConstantOperandVal(2);
break;
@@ -52428,10 +52426,14 @@ static bool onlyZeroFlagUsed(SDValue Flags) {
default:
// Be conservative.
return false;
- case X86ISD::SETCC: CCOpNo = 0; break;
- case X86ISD::SETCC_CARRY: CCOpNo = 0; break;
- case X86ISD::BRCOND: CCOpNo = 2; break;
- case X86ISD::CMOV: CCOpNo = 2; break;
+ case X86ISD::SETCC:
+ case X86ISD::SETCC_CARRY:
+ CCOpNo = 0;
+ break;
+ case X86ISD::BRCOND:
+ case X86ISD::CMOV:
+ CCOpNo = 2;
+ break;
}
X86::CondCode CC = (X86::CondCode)User->getConstantOperandVal(CCOpNo);
More information about the llvm-commits
mailing list