[llvm] [RISCV] Use ri.vzip2{a, b} for interleave2 if available (PR #136364)
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 21 10:44:01 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()) {
----------------
preames wrote:
The vrgather case doesn't have a problem with undef propagation because it's only one use of each operand. The guard here honestly isn't entirely sufficient, we probably need to be using freeze in both this case and the unzip2a/b case I added. The guard I added wasn't directly motivated by the legality issue (I'm going to return to that shortly in it's own patch), it was motivated by profitability. Loosing the zero extend lowering for the spread2 case causes a few of the tests to regress. I'm going to post a patch to reorganize things, but doing it as a separate change seemed easier.
https://github.com/llvm/llvm-project/pull/136364
More information about the llvm-commits
mailing list