Skip to content

Commit 5259c84

Browse files
committed
Unite template verion and non-template version
1 parent 13f100d commit 5259c84

File tree

1 file changed

+53
-83
lines changed

1 file changed

+53
-83
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp

Lines changed: 53 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -2226,12 +2226,19 @@ static mlir::Value vecReduceIntValue(CIRGenFunction &cgf, mlir::Value val,
22262226
loc, val, builder.getConstInt(loc, cgf.SizeTy, 0));
22272227
}
22282228

2229-
static void prepareNeonCallArgs(CIRGenBuilderTy &builder,
2230-
llvm::SmallVector<mlir::Type> argTypes,
2231-
llvm::SmallVectorImpl<mlir::Value> &args,
2232-
mlir::Location loc,
2233-
bool isConstrainedFPIntrinsic, unsigned shift,
2234-
bool rightshift) {
2229+
template <typename Operation>
2230+
static mlir::Value emitNeonCallToOp(
2231+
CIRGenBuilderTy &builder, llvm::SmallVector<mlir::Type> argTypes,
2232+
llvm::SmallVectorImpl<mlir::Value> &args,
2233+
std::optional<llvm::StringRef> intrinsicName, mlir::Type funcResTy,
2234+
mlir::Location loc, bool isConstrainedFPIntrinsic = false,
2235+
unsigned shift = 0, bool rightshift = false) {
2236+
// TODO: Consider removing the following unreachable when we have
2237+
// emitConstrainedFPCall feature implemented
2238+
assert(!cir::MissingFeatures::emitConstrainedFPCall());
2239+
if (isConstrainedFPIntrinsic)
2240+
llvm_unreachable("isConstrainedFPIntrinsic NYI");
2241+
22352242
for (unsigned j = 0; j < argTypes.size(); ++j) {
22362243
if (isConstrainedFPIntrinsic) {
22372244
assert(!cir::MissingFeatures::emitConstrainedFPCall());
@@ -2244,56 +2251,19 @@ static void prepareNeonCallArgs(CIRGenBuilderTy &builder,
22442251
args[j] = builder.createBitcast(args[j], argTypes[j]);
22452252
}
22462253
}
2247-
}
2248-
2249-
static mlir::Value emitNeonCall(CIRGenBuilderTy &builder,
2250-
llvm::SmallVector<mlir::Type> argTypes,
2251-
llvm::SmallVectorImpl<mlir::Value> &args,
2252-
llvm::StringRef intrinsicName,
2253-
mlir::Type funcResTy, mlir::Location loc,
2254-
bool isConstrainedFPIntrinsic = false,
2255-
unsigned shift = 0, bool rightshift = false) {
2256-
// TODO: Consider removing the following unreachable when we have
2257-
// emitConstrainedFPCall feature implemented
2258-
assert(!cir::MissingFeatures::emitConstrainedFPCall());
2259-
if (isConstrainedFPIntrinsic)
2260-
llvm_unreachable("isConstrainedFPIntrinsic NYI");
2261-
2262-
prepareNeonCallArgs(builder, std::move(argTypes), args, loc,
2263-
isConstrainedFPIntrinsic, shift, rightshift);
22642254

22652255
if (isConstrainedFPIntrinsic) {
22662256
assert(!cir::MissingFeatures::emitConstrainedFPCall());
22672257
return nullptr;
22682258
}
2269-
return builder
2270-
.create<cir::LLVMIntrinsicCallOp>(
2271-
loc, builder.getStringAttr(intrinsicName), funcResTy, args)
2272-
.getResult();
2273-
}
2274-
2275-
// This one is similar to the function above, except for creating an operation
2276-
// from template instead of creating a LLVMIntrinsicCallOp
2277-
template <typename Operation>
2278-
static mlir::Value
2279-
emitNeonCall(CIRGenBuilderTy &builder, llvm::SmallVector<mlir::Type> argTypes,
2280-
llvm::SmallVectorImpl<mlir::Value> &args, mlir::Type funcResTy,
2281-
mlir::Location loc, bool isConstrainedFPIntrinsic = false,
2282-
unsigned shift = 0, bool rightshift = false) {
2283-
// TODO: Consider removing the following unreachable when we have
2284-
// emitConstrainedFPCall feature implemented
2285-
assert(!cir::MissingFeatures::emitConstrainedFPCall());
2286-
if (isConstrainedFPIntrinsic)
2287-
llvm_unreachable("isConstrainedFPIntrinsic NYI");
2288-
2289-
prepareNeonCallArgs(builder, std::move(argTypes), args, loc,
2290-
isConstrainedFPIntrinsic, shift, rightshift);
2291-
2292-
if (isConstrainedFPIntrinsic) {
2293-
assert(!cir::MissingFeatures::emitConstrainedFPCall());
2294-
return nullptr;
2259+
if constexpr (std::is_same_v<Operation, cir::LLVMIntrinsicCallOp>) {
2260+
return builder
2261+
.create<Operation>(loc, builder.getStringAttr(intrinsicName.value()),
2262+
funcResTy, args)
2263+
.getResult();
2264+
} else {
2265+
return builder.create<Operation>(loc, funcResTy, args).getResult();
22952266
}
2296-
return builder.create<Operation>(loc, funcResTy, args).getResult();
22972267
}
22982268

22992269
/// This function `emitCommonNeonCallPattern0` implements a common way
@@ -2315,7 +2285,7 @@ emitCommonNeonCallPattern0(CIRGenFunction &cgf, llvm::StringRef intrincsName,
23152285
argTypes = {funcResTy, funcResTy};
23162286
}
23172287
mlir::Value res =
2318-
emitNeonCall(builder, std::move(argTypes), ops, intrincsName, funcResTy,
2288+
emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, std::move(argTypes), ops, intrincsName, funcResTy,
23192289
cgf.getLoc(e->getExprLoc()));
23202290
mlir::Type resultType = cgf.convertType(e->getType());
23212291
return builder.createBitcast(res, resultType);
@@ -2337,7 +2307,7 @@ static mlir::Value emitCommonNeonVecAcrossCall(CIRGenFunction &cgf,
23372307
cir::VectorType vTy =
23382308
cir::VectorType::get(&cgf.getMLIRContext(), eltTy, vecLen);
23392309
llvm::SmallVector<mlir::Value, 1> args{op};
2340-
return emitNeonCall(builder, {vTy}, args, intrincsName, eltTy,
2310+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {vTy}, args, intrincsName, eltTy,
23412311
cgf.getLoc(e->getExprLoc()));
23422312
}
23432313

@@ -2420,7 +2390,7 @@ mlir::Value CIRGenFunction::emitCommonNeonBuiltinExpr(
24202390
case NEON::BI__builtin_neon_vpaddlq_v: {
24212391
// The source operand type has twice as many elements of half the size.
24222392
cir::VectorType narrowTy = getHalfEltSizeTwiceNumElemsVecType(builder, vTy);
2423-
return emitNeonCall(builder, {narrowTy}, ops,
2393+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {narrowTy}, ops,
24242394
isUnsigned ? "aarch64.neon.uaddlp"
24252395
: "aarch64.neon.saddlp",
24262396
vTy, getLoc(e->getExprLoc()));
@@ -2431,10 +2401,10 @@ mlir::Value CIRGenFunction::emitCommonNeonBuiltinExpr(
24312401
cir::VectorType srcVty = builder.getExtendedOrTruncatedElementVectorType(
24322402
vTy, false, /* truncate */
24332403
mlir::cast<cir::IntType>(vTy.getEltType()).isSigned());
2434-
ops[1] = emitNeonCall(builder, {srcVty, srcVty}, mulOps,
2404+
ops[1] = emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {srcVty, srcVty}, mulOps,
24352405
"aarch64.neon.sqdmull", vTy, getLoc(e->getExprLoc()));
24362406
ops.resize(2);
2437-
return emitNeonCall(builder, {vTy, vTy}, ops,
2407+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {vTy, vTy}, ops,
24382408
builtinID == NEON::BI__builtin_neon_vqdmlal_v
24392409
? "aarch64.neon.sqadd"
24402410
: "aarch64.neon.sqsub",
@@ -2472,7 +2442,7 @@ mlir::Value CIRGenFunction::emitCommonNeonBuiltinExpr(
24722442
cir::VectorType mulVecT =
24732443
GetNeonType(this, NeonTypeFlags(neonType.getEltType(), false,
24742444
/*isQuad*/ false));
2475-
return emitNeonCall(builder, {resTy, mulVecT, SInt32Ty}, ops,
2445+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {resTy, mulVecT, SInt32Ty}, ops,
24762446
(builtinID == NEON::BI__builtin_neon_vqdmulhq_lane_v ||
24772447
builtinID == NEON::BI__builtin_neon_vqdmulh_lane_v)
24782448
? "aarch64.neon.sqdmulh.lane"
@@ -2484,15 +2454,15 @@ mlir::Value CIRGenFunction::emitCommonNeonBuiltinExpr(
24842454
// These intrinsics expect signed vector type as input, but
24852455
// return unsigned vector type.
24862456
cir::VectorType srcTy = getSignChangedVectorType(builder, vTy);
2487-
return emitNeonCall(builder, {srcTy, srcTy}, ops, "aarch64.neon.sqshlu",
2457+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {srcTy, srcTy}, ops, "aarch64.neon.sqshlu",
24882458
vTy, getLoc(e->getExprLoc()),
24892459
false, /* not fp constrained op */
24902460
1, /* second arg is shift amount */
24912461
false /* leftshift */);
24922462
}
24932463
case NEON::BI__builtin_neon_vrshr_n_v:
24942464
case NEON::BI__builtin_neon_vrshrq_n_v: {
2495-
return emitNeonCall(
2465+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(
24962466
builder,
24972467
{vTy, isUnsigned ? getSignChangedVectorType(builder, vTy) : vTy}, ops,
24982468
isUnsigned ? "aarch64.neon.urshl" : "aarch64.neon.srshl", vTy,
@@ -2698,25 +2668,25 @@ static mlir::Value emitCommonNeonSISDBuiltinExpr(
26982668
case NEON::BI__builtin_neon_vaddlvq_s32:
26992669
llvm_unreachable(" neon_vaddlvq_s32 NYI ");
27002670
case NEON::BI__builtin_neon_vaddlvq_u32:
2701-
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.uaddlv", resultTy,
2671+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {argTy}, ops, "aarch64.neon.uaddlv", resultTy,
27022672
loc);
27032673
case NEON::BI__builtin_neon_vaddv_f32:
27042674
case NEON::BI__builtin_neon_vaddvq_f32:
27052675
case NEON::BI__builtin_neon_vaddvq_f64:
2706-
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.faddv", resultTy,
2676+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {argTy}, ops, "aarch64.neon.faddv", resultTy,
27072677
loc);
27082678
case NEON::BI__builtin_neon_vaddv_s32:
27092679
case NEON::BI__builtin_neon_vaddvq_s32:
27102680
case NEON::BI__builtin_neon_vaddvq_s64:
2711-
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.saddv", resultTy,
2681+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {argTy}, ops, "aarch64.neon.saddv", resultTy,
27122682
loc);
27132683
case NEON::BI__builtin_neon_vaddv_u32:
27142684
case NEON::BI__builtin_neon_vaddvq_u32:
27152685
case NEON::BI__builtin_neon_vaddvq_u64:
2716-
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.uaddv", resultTy,
2686+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {argTy}, ops, "aarch64.neon.uaddv", resultTy,
27172687
loc);
27182688
case NEON::BI__builtin_neon_vcaged_f64: {
2719-
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.facge", resultTy,
2689+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {argTy}, ops, "aarch64.neon.facge", resultTy,
27202690
loc);
27212691
}
27222692
case NEON::BI__builtin_neon_vcages_f32:
@@ -2906,7 +2876,7 @@ static mlir::Value emitCommonNeonSISDBuiltinExpr(
29062876
cir::VectorType resVecTy =
29072877
cir::VectorType::get(&(cgf.getMLIRContext()), cgf.SInt16Ty, 4);
29082878
vecExtendIntValue(cgf, argVecTy, ops[0], loc);
2909-
mlir::Value result = emitNeonCall(builder, {argVecTy}, ops,
2879+
mlir::Value result = emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {argVecTy}, ops,
29102880
"aarch64.neon.sqxtn", resVecTy, loc);
29112881
return vecReduceIntValue(cgf, result, loc);
29122882
}
@@ -2937,7 +2907,7 @@ static mlir::Value emitCommonNeonSISDBuiltinExpr(
29372907
case NEON::BI__builtin_neon_vqrdmulhh_s16:
29382908
llvm_unreachable(" neon_vqrdmulhh_s16 NYI ");
29392909
case NEON::BI__builtin_neon_vqrdmulhs_s32:
2940-
return emitNeonCall(builder, {resultTy, resultTy}, ops,
2910+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {resultTy, resultTy}, ops,
29412911
"aarch64.neon.sqrdmulh", resultTy, loc);
29422912
case NEON::BI__builtin_neon_vqrshlb_s8:
29432913
llvm_unreachable(" neon_vqrshlb_s8 NYI ");
@@ -3843,7 +3813,7 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
38433813
assert(APSInt && "Expected argument to be a constant");
38443814
Ops[1] = builder.getSInt64(APSInt->getZExtValue(), getLoc(E->getExprLoc()));
38453815
const StringRef Intrinsic = "aarch64.neon.sqshlu";
3846-
return emitNeonCall(builder, {IntType, IntType}, Ops, Intrinsic, IntType,
3816+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {IntType, IntType}, Ops, Intrinsic, IntType,
38473817
getLoc(E->getExprLoc()));
38483818
}
38493819
case NEON::BI__builtin_neon_vqshld_n_u64:
@@ -3857,7 +3827,7 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
38573827
: "aarch64.neon.sqshl";
38583828
Ops.push_back(emitScalarExpr(E->getArg(1)));
38593829
Ops[1] = builder.createIntCast(Ops[1], IntType);
3860-
return emitNeonCall(builder, {IntType, IntType}, Ops, Intrinsic, IntType,
3830+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {IntType, IntType}, Ops, Intrinsic, IntType,
38613831
getLoc(E->getExprLoc()));
38623832
}
38633833
case NEON::BI__builtin_neon_vrshrd_n_u64:
@@ -3875,7 +3845,7 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
38753845
assert(APSInt && "Expected argument to be a constant");
38763846
int64_t SV = -APSInt->getSExtValue();
38773847
Ops[1] = builder.getSInt64(SV, getLoc(E->getExprLoc()));
3878-
return emitNeonCall(builder, {IntType, builder.getSInt64Ty()}, Ops,
3848+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {IntType, builder.getSInt64Ty()}, Ops,
38793849
Intrinsic, IntType, getLoc(E->getExprLoc()));
38803850
}
38813851
case NEON::BI__builtin_neon_vrsrad_n_u64:
@@ -3892,7 +3862,7 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
38923862

38933863
llvm::SmallVector<mlir::Value, 2> args = {
38943864
Ops[1], builder.createIntCast(Ops[2], IntType)};
3895-
Ops[1] = emitNeonCall(builder, {IntType, IntType}, args, Intrinsic, IntType,
3865+
Ops[1] = emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {IntType, IntType}, args, Intrinsic, IntType,
38963866
getLoc(E->getExprLoc()));
38973867
return builder.createAdd(Ops[0], builder.createBitcast(Ops[1], IntType));
38983868
}
@@ -4040,7 +4010,7 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
40404010
name = "aarch64.neon.pmull";
40414011
cir::VectorType argTy = builder.getExtendedOrTruncatedElementVectorType(
40424012
ty, false /* truncated */, !usgn);
4043-
return emitNeonCall(builder, {argTy, argTy}, Ops, name, ty,
4013+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {argTy, argTy}, Ops, name, ty,
40444014
getLoc(E->getExprLoc()));
40454015
}
40464016
case NEON::BI__builtin_neon_vmax_v:
@@ -4061,7 +4031,7 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
40614031
llvm::StringRef name = usgn ? "aarch64.neon.umin" : "aarch64.neon.smin";
40624032
if (cir::isFPOrFPVectorTy(ty))
40634033
name = "aarch64.neon.fmin";
4064-
return emitNeonCall(builder, {ty, ty}, Ops, name, ty,
4034+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {ty, ty}, Ops, name, ty,
40654035
getLoc(E->getExprLoc()));
40664036
}
40674037
case NEON::BI__builtin_neon_vminh_f16: {
@@ -4072,15 +4042,15 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
40724042
llvm::StringRef name = usgn ? "aarch64.neon.uabd" : "aarch64.neon.sabd";
40734043
if (cir::isFPOrFPVectorTy(ty))
40744044
name = "aarch64.neon.fabd";
4075-
return emitNeonCall(builder, {ty, ty}, Ops, name, ty,
4045+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {ty, ty}, Ops, name, ty,
40764046
getLoc(E->getExprLoc()));
40774047
}
40784048
case NEON::BI__builtin_neon_vpadal_v:
40794049
case NEON::BI__builtin_neon_vpadalq_v: {
40804050
cir::VectorType argTy = getHalfEltSizeTwiceNumElemsVecType(builder, vTy);
40814051
mlir::Location loc = getLoc(E->getExprLoc());
40824052
llvm::SmallVector<mlir::Value, 1> args = {Ops[1]};
4083-
mlir::Value tmp = emitNeonCall(
4053+
mlir::Value tmp = emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(
40844054
builder, {argTy}, args,
40854055
usgn ? "aarch64.neon.uaddlp" : "aarch64.neon.saddlp", vTy, loc);
40864056
mlir::Value addEnd = builder.createBitcast(Ops[0], vTy);
@@ -4114,13 +4084,13 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
41144084
case NEON::BI__builtin_neon_vqrshrun_n_v:
41154085
// The prototype of builtin_neon_vqrshrun_n can be found at
41164086
// https://developer.arm.com/architectures/instruction-sets/intrinsics/
4117-
return emitNeonCall(
4087+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(
41184088
builder,
41194089
{builder.getExtendedOrTruncatedElementVectorType(ty, true, true),
41204090
SInt32Ty},
41214091
Ops, "aarch64.neon.sqrshrun", ty, getLoc(E->getExprLoc()));
41224092
case NEON::BI__builtin_neon_vqshrn_n_v:
4123-
return emitNeonCall(
4093+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(
41244094
builder,
41254095
{builder.getExtendedOrTruncatedElementVectorType(
41264096
vTy, true /* extend */,
@@ -4129,15 +4099,15 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
41294099
Ops, usgn ? "aarch64.neon.uqshrn" : "aarch64.neon.sqshrn", ty,
41304100
getLoc(E->getExprLoc()));
41314101
case NEON::BI__builtin_neon_vrshrn_n_v:
4132-
return emitNeonCall(
4102+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(
41334103
builder,
41344104
{builder.getExtendedOrTruncatedElementVectorType(
41354105
vTy, true /* extend */,
41364106
mlir::cast<cir::IntType>(vTy.getEltType()).isSigned()),
41374107
SInt32Ty},
41384108
Ops, "aarch64.neon.rshrn", ty, getLoc(E->getExprLoc()));
41394109
case NEON::BI__builtin_neon_vqrshrn_n_v:
4140-
return emitNeonCall(
4110+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(
41414111
builder,
41424112
{builder.getExtendedOrTruncatedElementVectorType(
41434113
vTy, true /* extend */,
@@ -4151,7 +4121,7 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
41514121
case NEON::BI__builtin_neon_vrnda_v:
41524122
case NEON::BI__builtin_neon_vrndaq_v: {
41534123
assert(!cir::MissingFeatures::emitConstrainedFPCall());
4154-
return emitNeonCall(builder, {ty}, Ops, "round", ty,
4124+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {ty}, Ops, "round", ty,
41554125
getLoc(E->getExprLoc()));
41564126
}
41574127
case NEON::BI__builtin_neon_vrndih_f16: {
@@ -4174,7 +4144,7 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
41744144
case NEON::BI__builtin_neon_vrndns_f32: {
41754145
mlir::Value arg0 = emitScalarExpr(E->getArg(0));
41764146
args.push_back(arg0);
4177-
return emitNeonCall<cir::RoundEvenOp>(builder, {arg0.getType()}, args,
4147+
return emitNeonCallToOp<cir::RoundEvenOp>(builder, {arg0.getType()}, args, std::nullopt,
41784148
getCIRGenModule().FloatTy,
41794149
getLoc(E->getExprLoc()));
41804150
}
@@ -4334,7 +4304,7 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
43344304
cir::VectorType vTy = cir::VectorType::get(builder.getContext(), eltTy, 4);
43354305
Ops.push_back(emitScalarExpr(E->getArg(0)));
43364306
// This is to add across the vector elements, so wider result type needed.
4337-
Ops[0] = emitNeonCall(builder, {vTy}, Ops,
4307+
Ops[0] = emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {vTy}, Ops,
43384308
usgn ? "aarch64.neon.uaddv" : "aarch64.neon.saddv",
43394309
SInt32Ty, getLoc(E->getExprLoc()));
43404310
return builder.createIntCast(Ops[0], eltTy);
@@ -4443,7 +4413,7 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
44434413
mlir::Type argTy = cir::VectorType::get(builder.getContext(),
44444414
usgn ? UInt16Ty : SInt16Ty, 8);
44454415
llvm::SmallVector<mlir::Value, 1> argOps = {emitScalarExpr(E->getArg(0))};
4446-
return emitNeonCall(builder, {argTy}, argOps,
4416+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {argTy}, argOps,
44474417
usgn ? "aarch64.neon.uaddlv" : "aarch64.neon.saddlv",
44484418
usgn ? UInt32Ty : SInt32Ty, getLoc(E->getExprLoc()));
44494419
}
@@ -4457,7 +4427,7 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
44574427
mlir::Type argTy = cir::VectorType::get(builder.getContext(),
44584428
usgn ? UInt16Ty : SInt16Ty, 4);
44594429
llvm::SmallVector<mlir::Value, 1> argOps = {emitScalarExpr(E->getArg(0))};
4460-
return emitNeonCall(builder, {argTy}, argOps,
4430+
return emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {argTy}, argOps,
44614431
usgn ? "aarch64.neon.uaddlv" : "aarch64.neon.saddlv",
44624432
usgn ? UInt32Ty : SInt32Ty, getLoc(E->getExprLoc()));
44634433
}
@@ -4487,7 +4457,7 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
44874457
cir::VectorType shitAmtVecTy =
44884458
usgn ? getSignChangedVectorType(builder, vTy) : vTy;
44894459
mlir::Value tmp =
4490-
emitNeonCall(builder, {vTy, shitAmtVecTy}, tmpOps,
4460+
emitNeonCallToOp<cir::LLVMIntrinsicCallOp>(builder, {vTy, shitAmtVecTy}, tmpOps,
44914461
usgn ? "aarch64.neon.urshl" : "aarch64.neon.srshl", vTy,
44924462
getLoc(E->getExprLoc()), false,
44934463
1 /* shift amount is args[1]*/, true /* right shift */);

0 commit comments

Comments
 (0)