@@ -6508,12 +6508,13 @@ IntrinsicLibrary::genMatchAllSync(mlir::Type resultType,
65086508}
65096509
65106510static mlir::Value genVoteSync (fir::FirOpBuilder &builder, mlir::Location loc,
6511- llvm::StringRef funcName,
6511+ llvm::StringRef funcName, mlir::Type resTy,
65126512 llvm::ArrayRef<mlir::Value> args) {
65136513 mlir::MLIRContext *context = builder.getContext ();
65146514 mlir::Type i32Ty = builder.getI32Type ();
6515+ mlir::Type i1Ty = builder.getI1Type ();
65156516 mlir::FunctionType ftype =
6516- mlir::FunctionType::get (context, {i32Ty, i32Ty }, {i32Ty });
6517+ mlir::FunctionType::get (context, {i32Ty, i1Ty }, {resTy });
65176518 auto funcOp = builder.createFunction (loc, funcName, ftype);
65186519 llvm::SmallVector<mlir::Value> filteredArgs;
65196520 return builder.create <fir::CallOp>(loc, funcOp, args).getResult (0 );
@@ -6523,22 +6524,25 @@ static mlir::Value genVoteSync(fir::FirOpBuilder &builder, mlir::Location loc,
65236524mlir::Value IntrinsicLibrary::genVoteAllSync (mlir::Type resultType,
65246525 llvm::ArrayRef<mlir::Value> args) {
65256526 assert (args.size () == 2 );
6526- return genVoteSync (builder, loc, " llvm.nvvm.vote.all.sync" , args);
6527+ return genVoteSync (builder, loc, " llvm.nvvm.vote.all.sync" ,
6528+ builder.getI1Type (), args);
65276529}
65286530
65296531// ANY_SYNC
65306532mlir::Value IntrinsicLibrary::genVoteAnySync (mlir::Type resultType,
65316533 llvm::ArrayRef<mlir::Value> args) {
65326534 assert (args.size () == 2 );
6533- return genVoteSync (builder, loc, " llvm.nvvm.vote.any.sync" , args);
6535+ return genVoteSync (builder, loc, " llvm.nvvm.vote.any.sync" ,
6536+ builder.getI1Type (), args);
65346537}
65356538
65366539// BALLOT_SYNC
65376540mlir::Value
65386541IntrinsicLibrary::genVoteBallotSync (mlir::Type resultType,
65396542 llvm::ArrayRef<mlir::Value> args) {
65406543 assert (args.size () == 2 );
6541- return genVoteSync (builder, loc, " llvm.nvvm.vote.ballot.sync" , args);
6544+ return genVoteSync (builder, loc, " llvm.nvvm.vote.ballot.sync" ,
6545+ builder.getI32Type (), args);
65426546}
65436547
65446548// MATCH_ANY_SYNC
0 commit comments