Skip to content

Commit 17e008d

Browse files
[IR] NFC: Remove 'experimental' from partial.reduce.add intrinsic (#158637)
The partial reduction intrinsics are no longer experimental, because they've been used in production for a while and are unlikely to change.
1 parent 1dbb932 commit 17e008d

34 files changed

+445
-425
lines changed

llvm/docs/LangRef.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20562,7 +20562,7 @@ Note that it has the following implications:
2056220562
- If ``%cnt`` is non-zero, the return value is non-zero as well.
2056320563
- If ``%cnt`` is less than or equal to ``%max_lanes``, the return value is equal to ``%cnt``.
2056420564

20565-
'``llvm.experimental.vector.partial.reduce.add.*``' Intrinsic
20565+
'``llvm.vector.partial.reduce.add.*``' Intrinsic
2056620566
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2056720567

2056820568
Syntax:
@@ -20571,15 +20571,15 @@ This is an overloaded intrinsic.
2057120571

2057220572
::
2057320573

20574-
declare <4 x i32> @llvm.experimental.vector.partial.reduce.add.v4i32.v4i32.v8i32(<4 x i32> %a, <8 x i32> %b)
20575-
declare <4 x i32> @llvm.experimental.vector.partial.reduce.add.v4i32.v4i32.v16i32(<4 x i32> %a, <16 x i32> %b)
20576-
declare <vscale x 4 x i32> @llvm.experimental.vector.partial.reduce.add.nxv4i32.nxv4i32.nxv8i32(<vscale x 4 x i32> %a, <vscale x 8 x i32> %b)
20577-
declare <vscale x 4 x i32> @llvm.experimental.vector.partial.reduce.add.nxv4i32.nxv4i32.nxv16i32(<vscale x 4 x i32> %a, <vscale x 16 x i32> %b)
20574+
declare <4 x i32> @llvm.vector.partial.reduce.add.v4i32.v4i32.v8i32(<4 x i32> %a, <8 x i32> %b)
20575+
declare <4 x i32> @llvm.vector.partial.reduce.add.v4i32.v4i32.v16i32(<4 x i32> %a, <16 x i32> %b)
20576+
declare <vscale x 4 x i32> @llvm.vector.partial.reduce.add.nxv4i32.nxv4i32.nxv8i32(<vscale x 4 x i32> %a, <vscale x 8 x i32> %b)
20577+
declare <vscale x 4 x i32> @llvm.vector.partial.reduce.add.nxv4i32.nxv4i32.nxv16i32(<vscale x 4 x i32> %a, <vscale x 16 x i32> %b)
2057820578

2057920579
Overview:
2058020580
"""""""""
2058120581

20582-
The '``llvm.vector.experimental.partial.reduce.add.*``' intrinsics reduce the
20582+
The '``llvm.vector.partial.reduce.add.*``' intrinsics reduce the
2058320583
concatenation of the two vector arguments down to the number of elements of the
2058420584
result vector type.
2058520585

llvm/include/llvm/Analysis/TargetTransformInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ class TargetTransformInfo {
13281328

13291329
/// \return The cost of a partial reduction, which is a reduction from a
13301330
/// vector to another vector with fewer elements of larger size. They are
1331-
/// represented by the llvm.experimental.partial.reduce.add intrinsic, which
1331+
/// represented by the llvm.vector.partial.reduce.add intrinsic, which
13321332
/// takes an accumulator of type \p AccumType and a second vector operand to
13331333
/// be accumulated, whose element count is specified by \p VF. The type of
13341334
/// reduction is specified by \p Opcode. The second operand passed to the

llvm/include/llvm/CodeGen/TargetLowering.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ class LLVM_ABI TargetLoweringBase {
480480
return true;
481481
}
482482

483-
/// Return true if the @llvm.experimental.vector.partial.reduce.* intrinsic
483+
/// Return true if the @llvm.vector.partial.reduce.* intrinsic
484484
/// should be expanded using generic code in SelectionDAGBuilder.
485485
virtual bool
486486
shouldExpandPartialReductionIntrinsic(const IntrinsicInst *I) const {

llvm/include/llvm/IR/Intrinsics.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,9 +2797,9 @@ foreach n = 2...8 in {
27972797

27982798
//===-------------- Intrinsics to perform partial reduction ---------------===//
27992799

2800-
def int_experimental_vector_partial_reduce_add : DefaultAttrsIntrinsic<[LLVMMatchType<0>],
2801-
[llvm_anyvector_ty, llvm_anyvector_ty],
2802-
[IntrNoMem]>;
2800+
def int_vector_partial_reduce_add : DefaultAttrsIntrinsic<[LLVMMatchType<0>],
2801+
[llvm_anyvector_ty, llvm_anyvector_ty],
2802+
[IntrNoMem]>;
28032803

28042804
//===----------------- Pointer Authentication Intrinsics ------------------===//
28052805
//

llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,8 +1022,7 @@ ComplexDeinterleavingGraph::identifyDotProduct(Value *V) {
10221022

10231023
CompositeNode *ANode = nullptr;
10241024

1025-
const Intrinsic::ID PartialReduceInt =
1026-
Intrinsic::experimental_vector_partial_reduce_add;
1025+
const Intrinsic::ID PartialReduceInt = Intrinsic::vector_partial_reduce_add;
10271026

10281027
Value *AReal = nullptr;
10291028
Value *AImag = nullptr;
@@ -1139,8 +1138,7 @@ ComplexDeinterleavingGraph::identifyPartialReduction(Value *R, Value *I) {
11391138
return nullptr;
11401139

11411140
auto *IInst = dyn_cast<IntrinsicInst>(*CommonUser);
1142-
if (!IInst || IInst->getIntrinsicID() !=
1143-
Intrinsic::experimental_vector_partial_reduce_add)
1141+
if (!IInst || IInst->getIntrinsicID() != Intrinsic::vector_partial_reduce_add)
11441142
return nullptr;
11451143

11461144
if (CompositeNode *CN = identifyDotProduct(IInst))

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8102,7 +8102,7 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
81028102
setValue(&I, Trunc);
81038103
return;
81048104
}
8105-
case Intrinsic::experimental_vector_partial_reduce_add: {
8105+
case Intrinsic::vector_partial_reduce_add: {
81068106
if (!TLI.shouldExpandPartialReductionIntrinsic(cast<IntrinsicInst>(&I))) {
81078107
visitTargetIntrinsic(I, Intrinsic);
81088108
return;

llvm/lib/IR/AutoUpgrade.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,8 @@ static bool upgradeIntrinsicFunction1(Function *F, Function *&NewFn,
12591259
.StartsWith("reverse.", Intrinsic::vector_reverse)
12601260
.StartsWith("interleave2.", Intrinsic::vector_interleave2)
12611261
.StartsWith("deinterleave2.", Intrinsic::vector_deinterleave2)
1262+
.StartsWith("partial.reduce.add",
1263+
Intrinsic::vector_partial_reduce_add)
12621264
.Default(Intrinsic::not_intrinsic);
12631265
if (ID != Intrinsic::not_intrinsic) {
12641266
const auto *FT = F->getFunctionType();
@@ -1269,7 +1271,8 @@ static bool upgradeIntrinsicFunction1(Function *F, Function *&NewFn,
12691271
Tys.push_back(FT->getReturnType());
12701272
if (ID != Intrinsic::vector_interleave2)
12711273
Tys.push_back(FT->getParamType(0));
1272-
if (ID == Intrinsic::vector_insert)
1274+
if (ID == Intrinsic::vector_insert ||
1275+
ID == Intrinsic::vector_partial_reduce_add)
12731276
// Inserting overloads the inserted type.
12741277
Tys.push_back(FT->getParamType(1));
12751278
rename(F);

llvm/lib/IR/Verifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6530,7 +6530,7 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
65306530
}
65316531
break;
65326532
}
6533-
case Intrinsic::experimental_vector_partial_reduce_add: {
6533+
case Intrinsic::vector_partial_reduce_add: {
65346534
VectorType *AccTy = cast<VectorType>(Call.getArgOperand(0)->getType());
65356535
VectorType *VecTy = cast<VectorType>(Call.getArgOperand(1)->getType());
65366536

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,8 +2184,7 @@ bool AArch64TargetLowering::shouldExpandGetActiveLaneMask(EVT ResVT,
21842184

21852185
bool AArch64TargetLowering::shouldExpandPartialReductionIntrinsic(
21862186
const IntrinsicInst *I) const {
2187-
assert(I->getIntrinsicID() ==
2188-
Intrinsic::experimental_vector_partial_reduce_add &&
2187+
assert(I->getIntrinsicID() == Intrinsic::vector_partial_reduce_add &&
21892188
"Unexpected intrinsic!");
21902189
return true;
21912190
}
@@ -17474,8 +17473,7 @@ bool AArch64TargetLowering::optimizeExtendOrTruncateConversion(
1747417473
if (match(SingleUser, m_c_Mul(m_Specific(I), m_SExt(m_Value()))))
1747517474
return true;
1747617475
if (match(SingleUser,
17477-
m_Intrinsic<
17478-
Intrinsic::experimental_vector_partial_reduce_add>(
17476+
m_Intrinsic<Intrinsic::vector_partial_reduce_add>(
1747917477
m_Value(), m_Specific(I))))
1748017478
return true;
1748117479
return false;
@@ -22522,8 +22520,7 @@ SDValue tryLowerPartialReductionToDot(SDNode *N,
2252222520
SelectionDAG &DAG) {
2252322521

2252422522
assert(N->getOpcode() == ISD::INTRINSIC_WO_CHAIN &&
22525-
getIntrinsicID(N) ==
22526-
Intrinsic::experimental_vector_partial_reduce_add &&
22523+
getIntrinsicID(N) == Intrinsic::vector_partial_reduce_add &&
2252722524
"Expected a partial reduction node");
2252822525

2252922526
bool Scalable = N->getValueType(0).isScalableVector();
@@ -22617,8 +22614,7 @@ SDValue tryLowerPartialReductionToWideAdd(SDNode *N,
2261722614
SelectionDAG &DAG) {
2261822615

2261922616
assert(N->getOpcode() == ISD::INTRINSIC_WO_CHAIN &&
22620-
getIntrinsicID(N) ==
22621-
Intrinsic::experimental_vector_partial_reduce_add &&
22617+
getIntrinsicID(N) == Intrinsic::vector_partial_reduce_add &&
2262222618
"Expected a partial reduction node");
2262322619

2262422620
if (!Subtarget->hasSVE2() && !Subtarget->isStreamingSVEAvailable())
@@ -22683,7 +22679,7 @@ static SDValue performIntrinsicCombine(SDNode *N,
2268322679
switch (IID) {
2268422680
default:
2268522681
break;
22686-
case Intrinsic::experimental_vector_partial_reduce_add: {
22682+
case Intrinsic::vector_partial_reduce_add: {
2268722683
if (SDValue Dot = tryLowerPartialReductionToDot(N, Subtarget, DAG))
2268822684
return Dot;
2268922685
if (SDValue WideAdd = tryLowerPartialReductionToWideAdd(N, Subtarget, DAG))

llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ MVT WebAssemblyTargetLowering::getPointerMemTy(const DataLayout &DL,
418418

419419
bool WebAssemblyTargetLowering::shouldExpandPartialReductionIntrinsic(
420420
const IntrinsicInst *I) const {
421-
if (I->getIntrinsicID() != Intrinsic::experimental_vector_partial_reduce_add)
421+
if (I->getIntrinsicID() != Intrinsic::vector_partial_reduce_add)
422422
return true;
423423

424424
EVT VT = EVT::getEVT(I->getType());
@@ -2117,8 +2117,7 @@ SDValue WebAssemblyTargetLowering::LowerVASTART(SDValue Op,
21172117
// extmul and adds.
21182118
SDValue performLowerPartialReduction(SDNode *N, SelectionDAG &DAG) {
21192119
assert(N->getOpcode() == ISD::INTRINSIC_WO_CHAIN);
2120-
if (N->getConstantOperandVal(0) !=
2121-
Intrinsic::experimental_vector_partial_reduce_add)
2120+
if (N->getConstantOperandVal(0) != Intrinsic::vector_partial_reduce_add)
21222121
return SDValue();
21232122

21242123
assert(N->getValueType(0) == MVT::v4i32 && "can only support v4i32");

0 commit comments

Comments
 (0)