Skip to content

Commit 7c540c0

Browse files
[X86] Use isNullConstant (NFC)
1 parent 38cc5bc commit 7c540c0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55243,11 +55243,10 @@ static SDValue combineScalarToVector(SDNode *N, SelectionDAG &DAG) {
5524355243
// Combine scalar_to_vector of an extract_vector_elt into an extract_subvec.
5524455244
if (VT == MVT::v1i1 && Src.getOpcode() == ISD::EXTRACT_VECTOR_ELT &&
5524555245
Src.hasOneUse() && Src.getOperand(0).getValueType().isVector() &&
55246-
Src.getOperand(0).getValueType().getVectorElementType() == MVT::i1)
55247-
if (auto *C = dyn_cast<ConstantSDNode>(Src.getOperand(1)))
55248-
if (C->isZero())
55249-
return DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, VT, Src.getOperand(0),
55250-
Src.getOperand(1));
55246+
Src.getOperand(0).getValueType().getVectorElementType() == MVT::i1 &&
55247+
isNullConstant(Src.getOperand(1)))
55248+
return DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, VT, Src.getOperand(0),
55249+
Src.getOperand(1));
5525155250

5525255251
// Reduce v2i64 to v4i32 if we don't need the upper bits or are known zero.
5525355252
// TODO: Move to DAGCombine/SimplifyDemandedBits?

0 commit comments

Comments
 (0)