================ @@ -25030,7 +25030,8 @@ static SDValue foldCSELofLASTB(SDNode *Op, SelectionDAG &DAG) { if (AnyPred.getOpcode() == AArch64ISD::REINTERPRET_CAST) AnyPred = AnyPred.getOperand(0); - if (TruePred != AnyPred && TruePred.getOpcode() != AArch64ISD::PTRUE) + if (TruePred != AnyPred && TruePred.getOpcode() != AArch64ISD::PTRUE && + !ISD::isConstantSplatVectorAllOnes(TruePred.getNode())) ---------------- paulwalker-arm wrote:
I think the original code here is broken because I don't see how you can ignore the `PTRUE`'s pattern? My guess is this line is essentially asking "Are all the active bits in `AnyPred` also active in `TruePred`?" and the `PTRUE` check is bing incorrectly used to match an all true predicate. If true then with this PR I think you can just remove the `PTRUE` check because your new code asks exactly that question. https://github.com/llvm/llvm-project/pull/139236 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits