[llvm] r335437 - [X86] Simplify some code by using isOneConstant. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 24 18:01:47 PDT 2018
Author: ctopper
Date: Sun Jun 24 18:01:47 2018
New Revision: 335437
URL: http://llvm.org/viewvc/llvm-project?rev=335437&view=rev
Log:
[X86] Simplify some code by using isOneConstant. NFC
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=335437&r1=335436&r2=335437&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sun Jun 24 18:01:47 2018
@@ -32741,8 +32741,7 @@ static SDValue combineSelect(SDNode *N,
SDValue AndNode = Cond.getOperand(0);
if (AndNode.getOpcode() == ISD::AND && CC == ISD::SETEQ &&
isNullConstant(Cond.getOperand(1)) &&
- isa<ConstantSDNode>(AndNode.getOperand(1)) &&
- cast<ConstantSDNode>(AndNode.getOperand(1))->getAPIntValue() == 1) {
+ isOneConstant(AndNode.getOperand(1))) {
// LHS and RHS swapped due to
// setcc outputting 1 when AND resulted in 0 and vice versa.
AndNode = DAG.getZExtOrTrunc(AndNode, DL, MVT::i8);
More information about the llvm-commits
mailing list