[llvm] [LLVM][CodeGen][SVE] Improve lowering of fixed length masked mem ops. (PR #134402)
Paul Walker via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 7 03:37:24 PDT 2025
================
@@ -28697,17 +28703,36 @@ static SDValue convertFixedMaskToScalableVector(SDValue Mask,
SDLoc DL(Mask);
EVT InVT = Mask.getValueType();
EVT ContainerVT = getContainerForFixedLengthVector(DAG, InVT);
-
- auto Pg = getPredicateForFixedLengthVector(DAG, DL, InVT);
+ SDValue Pg = getPredicateForFixedLengthVector(DAG, DL, InVT);
if (ISD::isBuildVectorAllOnes(Mask.getNode()))
return Pg;
- auto Op1 = convertToScalableVector(DAG, ContainerVT, Mask);
- auto Op2 = DAG.getConstant(0, DL, ContainerVT);
+ bool InvertCond = false;
+ if (isBitwiseNot(Mask)) {
+ InvertCond = true;
+ Mask = Mask.getOperand(0);
+ }
+
+ SDValue Op1, Op2;
+ ISD::CondCode CC;
+
+ // When Mask is the result of a SETCC, it's better to regenerate the compare.
+ if (Mask.getOpcode() == ISD::SETCC) {
+ Op1 = convertToScalableVector(DAG, ContainerVT, Mask.getOperand(0));
----------------
paulwalker-arm wrote:
I don't believe mixing element sizes like this is legal for NEON. The expectation is that all vector types will have the same element count and bit length. You can see this today (albeit slightly less so since I've refactored the integer side) but for NEON we simply lower SETCC operations onto AArch64ISD::FCM## operations who definitions have the same requirement.
https://github.com/llvm/llvm-project/pull/134402
More information about the llvm-commits
mailing list