@@ -2217,6 +2217,13 @@ buildCommonNeonCallPattern0(CIRGenFunction &cgf, llvm::StringRef intrincsName,
2217
2217
llvm::SmallVectorImpl<mlir::Value> &ops,
2218
2218
mlir::Type funcResTy, const clang::CallExpr *e) {
2219
2219
CIRGenBuilderTy &builder = cgf.getBuilder ();
2220
+ if (argTypes.empty ()) {
2221
+ // The most common arg types is {funcResTy, funcResTy} for neon intrinsic
2222
+ // functions. Thus, it is as default so call site does not need to
2223
+ // provide it. Every neon intrinsic function has at least one argument,
2224
+ // Thus empty argTypes really just means {funcResTy, funcResTy}.
2225
+ argTypes = {funcResTy, funcResTy};
2226
+ }
2220
2227
mlir::Value res =
2221
2228
buildNeonCall (builder, std::move (argTypes), ops, intrincsName, funcResTy,
2222
2229
cgf.getLoc (e->getExprLoc ()));
@@ -2359,6 +2366,7 @@ mlir::Value CIRGenFunction::buildCommonNeonBuiltinExpr(
2359
2366
// This second switch is for the intrinsics that might have a more generic
2360
2367
// codegen solution so we can use the common codegen in future.
2361
2368
llvm::StringRef intrincsName;
2369
+ llvm::SmallVector<mlir::Type> argTypes;
2362
2370
switch (builtinID) {
2363
2371
default :
2364
2372
llvm::errs () << getAArch64SIMDIntrinsicString (builtinID) << " " ;
@@ -2390,11 +2398,18 @@ mlir::Value CIRGenFunction::buildCommonNeonBuiltinExpr(
2390
2398
: " llvm.aarch64.neon.srhadd" ;
2391
2399
break ;
2392
2400
}
2401
+ case NEON::BI__builtin_neon_vqmovun_v: {
2402
+ intrincsName = " llvm.aarch64.neon.sqxtun" ;
2403
+ argTypes.push_back (builder.getExtendedOrTruncatedElementVectorType (
2404
+ vTy, true /* extended */ , true /* signed */ ));
2405
+ break ;
2393
2406
}
2394
- if (!intrincsName.empty ())
2395
- return buildCommonNeonCallPattern0 (*this , intrincsName, {vTy, vTy}, ops,
2396
- vTy, e);
2397
- return nullptr ;
2407
+ }
2408
+
2409
+ if (intrincsName.empty ())
2410
+ return nullptr ;
2411
+ return buildCommonNeonCallPattern0 (*this , intrincsName, argTypes, ops, vTy,
2412
+ e);
2398
2413
}
2399
2414
2400
2415
mlir::Value
0 commit comments