@@ -8974,10 +8974,12 @@ IntrinsicLibrary::genSyncThreadsAnd(mlir::Type resultType,
89748974 llvm::ArrayRef<mlir::Value> args) {
89758975 constexpr llvm::StringLiteral funcName = " llvm.nvvm.barrier0.and" ;
89768976 mlir::MLIRContext *context = builder.getContext ();
8977+ mlir::Type i32 = builder.getI32Type ();
89778978 mlir::FunctionType ftype =
8978- mlir::FunctionType::get (context, {resultType}, {args[ 0 ]. getType () });
8979+ mlir::FunctionType::get (context, {resultType}, {i32 });
89798980 auto funcOp = builder.createFunction (loc, funcName, ftype);
8980- return fir::CallOp::create (builder, loc, funcOp, args).getResult (0 );
8981+ mlir::Value arg = builder.createConvert (loc, i32 , args[0 ]);
8982+ return fir::CallOp::create (builder, loc, funcOp, {arg}).getResult (0 );
89818983}
89828984
89838985// SYNCTHREADS_COUNT
@@ -8986,10 +8988,12 @@ IntrinsicLibrary::genSyncThreadsCount(mlir::Type resultType,
89868988 llvm::ArrayRef<mlir::Value> args) {
89878989 constexpr llvm::StringLiteral funcName = " llvm.nvvm.barrier0.popc" ;
89888990 mlir::MLIRContext *context = builder.getContext ();
8991+ mlir::Type i32 = builder.getI32Type ();
89898992 mlir::FunctionType ftype =
8990- mlir::FunctionType::get (context, {resultType}, {args[ 0 ]. getType () });
8993+ mlir::FunctionType::get (context, {resultType}, {i32 });
89918994 auto funcOp = builder.createFunction (loc, funcName, ftype);
8992- return fir::CallOp::create (builder, loc, funcOp, args).getResult (0 );
8995+ mlir::Value arg = builder.createConvert (loc, i32 , args[0 ]);
8996+ return fir::CallOp::create (builder, loc, funcOp, {arg}).getResult (0 );
89938997}
89948998
89958999// SYNCTHREADS_OR
@@ -8998,10 +9002,12 @@ IntrinsicLibrary::genSyncThreadsOr(mlir::Type resultType,
89989002 llvm::ArrayRef<mlir::Value> args) {
89999003 constexpr llvm::StringLiteral funcName = " llvm.nvvm.barrier0.or" ;
90009004 mlir::MLIRContext *context = builder.getContext ();
9005+ mlir::Type i32 = builder.getI32Type ();
90019006 mlir::FunctionType ftype =
9002- mlir::FunctionType::get (context, {resultType}, {args[ 0 ]. getType () });
9007+ mlir::FunctionType::get (context, {resultType}, {i32 });
90039008 auto funcOp = builder.createFunction (loc, funcName, ftype);
9004- return fir::CallOp::create (builder, loc, funcOp, args).getResult (0 );
9009+ mlir::Value arg = builder.createConvert (loc, i32 , args[0 ]);
9010+ return fir::CallOp::create (builder, loc, funcOp, {arg}).getResult (0 );
90059011}
90069012
90079013// SYNCWARP
0 commit comments