diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.h b/llvm/lib/Target/AArch64/AArch64ISelLowering.h --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.h +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.h @@ -323,7 +323,6 @@ INSR, PTEST, PTRUE, - PFALSE, BITREVERSE_MERGE_PASSTHRU, BSWAP_MERGE_PASSTHRU, diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -2201,7 +2201,6 @@ MAKE_CASE(AArch64ISD::INSR) MAKE_CASE(AArch64ISD::PTEST) MAKE_CASE(AArch64ISD::PTRUE) - MAKE_CASE(AArch64ISD::PFALSE) MAKE_CASE(AArch64ISD::LD1_MERGE_ZERO) MAKE_CASE(AArch64ISD::LD1S_MERGE_ZERO) MAKE_CASE(AArch64ISD::LDNF1_MERGE_ZERO) @@ -9985,8 +9984,9 @@ // The only legal i1 vectors are SVE vectors, so we can use SVE-specific // lowering code. if (auto *ConstVal = dyn_cast(SplatVal)) { + // We can hande the zero case during isel. if (ConstVal->isZero()) - return DAG.getNode(AArch64ISD::PFALSE, dl, VT); + return Op; if (ConstVal->isOne()) return getPTrue(DAG, dl, VT, AArch64SVEPredPattern::all); } @@ -15092,7 +15092,7 @@ while (N.getOpcode() == AArch64ISD::REINTERPRET_CAST) N = N.getOperand(0); - return N.getOpcode() == AArch64ISD::PFALSE; + return ISD::isConstantSplatVectorAllZeros(N.getNode()); } static bool isAllActivePredicate(SelectionDAG &DAG, SDValue N) { diff --git a/llvm/lib/Target/AArch64/SVEInstrFormats.td b/llvm/lib/Target/AArch64/SVEInstrFormats.td --- a/llvm/lib/Target/AArch64/SVEInstrFormats.td +++ b/llvm/lib/Target/AArch64/SVEInstrFormats.td @@ -334,8 +334,6 @@ def SDT_AArch64PTrue : SDTypeProfile<1, 1, [SDTCisVec<0>, SDTCisVT<1, i32>]>; def AArch64ptrue : SDNode<"AArch64ISD::PTRUE", SDT_AArch64PTrue>; -def SDT_AArch64PFalse : SDTypeProfile<1, 0, [SDTCisVec<0>, SDTCVecEltisVT<0, i1>]>; -def AArch64pfalse : SDNode<"AArch64ISD::PFALSE", SDT_AArch64PFalse>; let Predicates = [HasSVEorStreamingSVE] in { defm PTRUE : sve_int_ptrue<0b000, "ptrue", AArch64ptrue>; @@ -614,10 +612,10 @@ multiclass sve_int_pfalse opc, string asm> { def NAME : sve_int_pfalse; - def : Pat<(nxv16i1 (AArch64pfalse)), (!cast(NAME))>; - def : Pat<(nxv8i1 (AArch64pfalse)), (!cast(NAME))>; - def : Pat<(nxv4i1 (AArch64pfalse)), (!cast(NAME))>; - def : Pat<(nxv2i1 (AArch64pfalse)), (!cast(NAME))>; + def : Pat<(nxv16i1 (splat_vector (i32 0))), (!cast(NAME))>; + def : Pat<(nxv8i1 (splat_vector (i32 0))), (!cast(NAME))>; + def : Pat<(nxv4i1 (splat_vector (i32 0))), (!cast(NAME))>; + def : Pat<(nxv2i1 (splat_vector (i32 0))), (!cast(NAME))>; } class sve_int_ptest opc, string asm>