[Mlir-commits] [clang] [llvm] [mlir] [NVPTX] Convert vector function nvvm.annotations to attributes (PR #127736)
Alex MacLean
llvmlistbot at llvm.org
Wed Feb 19 12:53:19 PST 2025
================
@@ -506,24 +507,15 @@ void NVPTXAsmPrinter::emitKernelFunctionDirectives(const Function &F,
// If the NVVM IR has some of reqntid* specified, then output
// the reqntid directive, and set the unspecified ones to 1.
// If none of Reqntid* is specified, don't output reqntid directive.
- std::optional<unsigned> Reqntidx = getReqNTIDx(F);
- std::optional<unsigned> Reqntidy = getReqNTIDy(F);
- std::optional<unsigned> Reqntidz = getReqNTIDz(F);
+ const auto ReqNTID = getReqNTID(F);
+ if (!ReqNTID.empty())
+ O << formatv(".reqntid {0:$[, ]}\n",
+ make_range(ReqNTID.begin(), ReqNTID.end()));
----------------
AlexMaclean wrote:
I agree it seems like it should not be necessary, but this was the only way I could get it to compile. If you know a cleaner/more idiomatic way to do this that would be great.
https://github.com/llvm/llvm-project/pull/127736
More information about the Mlir-commits
mailing list