[llvm] [AArch64][SelectionDAG] Improve codegen for insert_into_scalable(zext_fixed_length_vector) (PR #192405)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 02:50:57 PDT 2026


================
@@ -20942,12 +20942,30 @@ static SDValue performReinterpretCastCombine(SDNode *N) {
   return SDValue();
 }
 
+// and(splat(1), sext(setcc_merge_zero)) -> zext(setcc_merge_zero)
+SDValue performSVEAndSplatSetCCMergeZeroCombine(SDNode *N, SelectionDAG &DAG) {
+  SDLoc DL(N);
+  SDValue SplatOp = N->getOperand(0);
+  SDValue NonSplatOp = N->getOperand(1);
+  if (NonSplatOp.getOpcode() == ISD::SPLAT_VECTOR)
+    std::swap(SplatOp, NonSplatOp);
----------------
paulwalker-arm wrote:

Is the necessary? getNode should canonicalise constants (including vector splats of constants) to the RHS.  We typically assume this when writing combines.

https://github.com/llvm/llvm-project/pull/192405


More information about the llvm-commits mailing list