Skip to content

Commit cf508aa

Browse files
committed
[RISCV] Remove last use of experimental.vp.splat in RISCVCodeGenPrepare. NFCI
Stacked on #170539 RISCVCodeGenPrepare is the last user of the vp.splat intrinsic, where it uses it to expand a zero strided load into a scalar load and splat. This replaces it with a regular splat followed by a vp_merge to set the lanes past EVL as poison. We need to set the EVL here because RISCVISelDAGToDAG will try and recombine it back into a zero strided load, and we want to preserve the original VL. We need to set
1 parent 1f1fef1 commit cf508aa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,10 @@ bool RISCVCodeGenPrepare::expandVPStrideLoad(IntrinsicInst &II) {
271271
IRBuilder<> Builder(&II);
272272
Type *STy = VTy->getElementType();
273273
Value *Val = Builder.CreateLoad(STy, BasePtr);
274-
Value *Res = Builder.CreateIntrinsic(Intrinsic::experimental_vp_splat, {VTy},
275-
{Val, II.getOperand(2), VL});
274+
Value *Res = Builder.CreateIntrinsic(
275+
Intrinsic::vp_merge, VTy,
276+
{II.getOperand(2), Builder.CreateVectorSplat(VTy->getElementCount(), Val),
277+
PoisonValue::get(VTy), VL});
276278

277279
II.replaceAllUsesWith(Res);
278280
II.eraseFromParent();

0 commit comments

Comments
 (0)