[llvm] [LLVM][CodeGen][SVE] Improve lowering of fixed length masked mem ops. (PR #134402)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 7 06:05:54 PDT 2025
================
@@ -20190,6 +20190,12 @@ performInsertSubvectorCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI,
EVT VecVT = Vec.getValueType();
EVT SubVT = SubVec.getValueType();
+ // Promote fixed length vector zeros.
+ if (VecVT.isScalableVector() && SubVT.isFixedLengthVector() &&
+ Vec.isUndef() && isZerosVector(SubVec.getNode()))
+ return VecVT.isInteger() ? DAG.getConstant(0, DL, VecVT)
+ : DAG.getConstantFP(0, DL, VecVT);
----------------
david-arm wrote:
Yeah this does look like a useful combine when applied to other constants, but like you say best for another PR. Not sure in practice if we'll actually end up with different assembly or not?
https://github.com/llvm/llvm-project/pull/134402
More information about the llvm-commits
mailing list