[llvm] [RISCV][llvm] Support BUILD_VECTOR codegen for P extension (PR #169083)

Brandon Wu via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 22 05:28:44 PST 2025


================
@@ -4434,6 +4435,29 @@ static SDValue lowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG,
 
   SDLoc DL(Op);
 
+  if (Subtarget.isRV32() && Subtarget.enablePExtCodeGen()) {
+    if (VT != MVT::v4i8)
+      return SDValue();
+
+    // <4 x i8> BUILD_VECTOR a, b, c, d -> PACK(PPACK.DH pair(a, b), pair(c, d))
+    SDValue Val0 = DAG.getNode(ISD::BITCAST, DL, MVT::v4i8, Op->getOperand(0));
----------------
4vtomat wrote:

I see, thanks for information!

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


More information about the llvm-commits mailing list