Skip to content

Commit 83e97d3

Browse files
author
Yeting Kuo
committed
Address comment.
1 parent ddf92da commit 83e97d3

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

llvm/docs/LangRef.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22853,26 +22853,26 @@ This is an overloaded intrinsic.
2285322853

2285422854
::
2285522855

22856-
declare <2 x double> @llvm.experimental.vp.splat.v2f64(<2 x double> %vec, <2 x i1> %mask, i32 %evl)
22857-
declare <vscale x 4 x i32> @llvm.experimental.vp.splat.nxv4i32(<vscale x 4 x i32> %vec, <vscale x 4 x i1> %mask, i32 %evl)
22856+
declare <2 x double> @llvm.experimental.vp.splat.v2f64(double %scalar, <2 x i1> %mask, i32 %evl)
22857+
declare <vscale x 4 x i32> @llvm.experimental.vp.splat.nxv4i32(i32 %scalar, <vscale x 4 x i1> %mask, i32 %evl)
2285822858

2285922859
Overview:
2286022860
"""""""""
2286122861

22862-
The '``llvm.experimental.vp.splat.*``' intrinsic is to create a prdicated splat
22862+
The '``llvm.experimental.vp.splat.*``' intrinsic is to create a predicated splat
2286322863
with specific effective vector length.
2286422864

2286522865
Arguments:
2286622866
""""""""""
2286722867

22868-
The result is a vector and it is a splat of the second scalar operand. The
22868+
The result is a vector and it is a splat of the first scalar argument. The
2286922869
second argument ``mask`` is a vector mask and has the same number of elements as
2287022870
the result. The third argument is the explicit vector length of the operation.
2287122871

2287222872
Semantics:
2287322873
""""""""""
2287422874

22875-
This intrinsic splats a vector with ``evl`` elements of a scalar operand.
22875+
This intrinsic splats a vector with ``evl`` elements of a scalar argument.
2287622876
The lanes in the result vector disabled by ``mask`` are ``poison``. The
2287722877
elements past ``evl`` are poison.
2287822878

@@ -22883,7 +22883,9 @@ Examples:
2288322883

2288422884
%r = call <4 x float> @llvm.vp.splat.v4f32(float %a, <4 x i1> %mask, i32 %evl)
2288522885
;; For all lanes below %evl, %r is lane-wise equivalent to %also.r
22886-
%also.r = select <4 x i1> %mask, <4 x float> splat(float %a), <4 x float> poison
22886+
%e = insertelement <4 x float> poison, float %a, i32 0
22887+
%s = shufflevector <4 x float> %e, <4 x float> poison, <4 x i32> zeroinitializer
22888+
%also.r = select <4 x i1> %mask, <4 x float> %s, <4 x float> poison
2288722889

2288822890

2288922891
.. _int_experimental_vp_reverse:

llvm/include/llvm/IR/VPIntrinsics.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ END_REGISTER_VP(experimental_vp_reverse, EXPERIMENTAL_VP_REVERSE)
777777

778778
///// } Shuffles
779779

780-
// llvm.vp.splat(ptr,val,mask,vlen)
780+
// llvm.vp.splat(val,mask,vlen)
781781
BEGIN_REGISTER_VP_INTRINSIC(experimental_vp_splat, 1, 2)
782782
BEGIN_REGISTER_VP_SDNODE(EXPERIMENTAL_VP_SPLAT, -1, experimental_vp_splat, 1, 2)
783783
VP_PROPERTY_NO_FUNCTIONAL

llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,8 +2215,8 @@ SDValue DAGTypeLegalizer::PromoteIntOp_INSERT_VECTOR_ELT(SDNode *N,
22152215
SDValue DAGTypeLegalizer::PromoteIntOp_ScalarOp(SDNode *N) {
22162216
SDValue Op = GetPromotedInteger(N->getOperand(0));
22172217
if (N->getOpcode() == ISD::EXPERIMENTAL_VP_SPLAT)
2218-
return DAG.getNode(ISD::EXPERIMENTAL_VP_SPLAT, SDLoc(N), N->getValueType(0),
2219-
Op, N->getOperand(1), N->getOperand(2));
2218+
return SDValue(
2219+
DAG.UpdateNodeOperands(N, Op, N->getOperand(1), N->getOperand(2)), 0);
22202220

22212221
// Integer SPLAT_VECTOR/SCALAR_TO_VECTOR operands are implicitly truncated,
22222222
// so just promote the operand in place.
@@ -5866,11 +5866,10 @@ SDValue DAGTypeLegalizer::PromoteIntRes_ScalarOp(SDNode *N) {
58665866
EVT NOutElemVT = NOutVT.getVectorElementType();
58675867

58685868
SDValue Op = DAG.getNode(ISD::ANY_EXTEND, dl, NOutElemVT, N->getOperand(0));
5869-
if (N->isVPOpcode()) {
5870-
SDValue Mask = N->getOperand(1);
5871-
SDValue VL = N->getOperand(2);
5872-
return DAG.getNode(N->getOpcode(), dl, NOutVT, Op, Mask, VL);
5873-
}
5869+
if (N->isVPOpcode())
5870+
return DAG.getNode(N->getOpcode(), dl, NOutVT, Op, N->getOperand(1),
5871+
N->getOperand(2));
5872+
58745873
return DAG.getNode(N->getOpcode(), dl, NOutVT, Op);
58755874
}
58765875

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11649,7 +11649,7 @@ SDValue RISCVTargetLowering::lowerVPSplatExperimental(SDValue Op,
1164911649
}
1165011650

1165111651
SDValue Result =
11652-
lowerScalarSplat(SDValue(), Val, VL, ContainerVT, DL, DAG, Subtarget);
11652+
lowerScalarSplat(SDValue(), Val, VL, ContainerVT, DL, DAG, Subtarget);
1165311653

1165411654
if (!VT.isFixedLengthVector())
1165511655
return Result;

0 commit comments

Comments
 (0)