[llvm] [RISCV] Use ri.vzip2{a, b} for interleave2 if available (PR #136364)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 20 20:46:32 PDT 2025


================
@@ -11753,6 +11753,17 @@ SDValue RISCVTargetLowering::lowerVECTOR_INTERLEAVE(SDValue Op,
     return DAG.getMergeValues(Loads, DL);
   }
 
+  // Use ri.vzip2{a,b} if available
+  // TODO: Figure out the best lowering for the spread variants
+  if (Subtarget.hasVendorXRivosVizip() && !Op.getOperand(0).isUndef() &&
+      !Op.getOperand(1).isUndef()) {
----------------
lukel97 wrote:

Good catch with the undef case. But should we only skip undefs if `VecVT.getScalarSizeInBits() < Subtarget.getELen()`? At e64 I don't think we get the vzext/vwsll.vx since it gets lowered as a vrgather.vv

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


More information about the llvm-commits mailing list