[clang] [llvm] [AArch64][SVE] Refactor getPTrue to return splat(1) when pattern=all. (PR #139236)
Graham Hunter via llvm-commits
llvm-commits at lists.llvm.org
Fri May 9 04:59:49 PDT 2025
================
@@ -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()))
----------------
huntergr-arm wrote:
I agree with Paul that we can remove the opcode check; I have a vague memory of looking for a helper function to determine whether the mask was all-true (or better, whether the ptest was redundant), not finding one, and just sticking a check for PTRUE in to get my tests up and running. Sadly I didn't revisit that before committing.
https://github.com/llvm/llvm-project/pull/139236
More information about the llvm-commits
mailing list