[llvm] b2f1932 - [X86] Use isOneConstant to simplify some code. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 29 18:02:51 PST 2019
Author: Craig Topper
Date: 2019-12-29T16:53:38-08:00
New Revision: b2f19320dc1ca82acd3939b18c5c73ee8833b735
URL: https://github.com/llvm/llvm-project/commit/b2f19320dc1ca82acd3939b18c5c73ee8833b735
DIFF: https://github.com/llvm/llvm-project/commit/b2f19320dc1ca82acd3939b18c5c73ee8833b735.diff
LOG: [X86] Use isOneConstant to simplify some code. NFC
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 65c8b02289e5..ff15c2b396b1 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -42496,8 +42496,7 @@ static SDValue foldXor1SetCC(SDNode *N, SelectionDAG &DAG) {
return SDValue();
SDValue LHS = N->getOperand(0);
- auto *RHSC = dyn_cast<ConstantSDNode>(N->getOperand(1));
- if (!RHSC || RHSC->getZExtValue() != 1 || LHS->getOpcode() != X86ISD::SETCC)
+ if (!OneConstant(N->getOperand(1)) || LHS->getOpcode() != X86ISD::SETCC)
return SDValue();
X86::CondCode NewCC = X86::GetOppositeBranchCondition(
More information about the llvm-commits
mailing list