[llvm] [NVPTX] Emit sub-byte kernel parameters as u8 in AsmPrinter (PR #226091)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 24 04:11:13 PDT 2026
wenhu1024 wrote:
> The < 8 check covers the sub-byte case, but every non-power-of-two width up to 64 hits the same ptxas error (.u9, .u12, .u24, .u48 → Parsing error near '.uN'), and globals print through the same function (.global .align 1 .u4 g4;). ISel already loads these params with max(8, PowerOf2Ceil(N)) bits, so rounding once in getPTXFundamentalTypeStr fixes all three call sites. Please check ##226113.<8>这个检查范围涵盖了子字节的情况。不过,所有宽度不是 2 的幂且小于 64 的情况都会导致相同的错误(.u9、.u12、.u24、.u48 都会导致“在’.uN’附近出现解析错误”)。此外,全局变量也是通过同一个函数来处理的(.global .align 1 .u4 g4;)。ISel 已经将这些参数的值设置为 max(8, PowerOf2Ceil(N))位,因此在 getPTXFundamentalTypeStr 函数中进行一次四舍五入处理后,这三个调用点的问题就能得到解决。请查看# #226113 。
Thanks for pointing this out. I will close my pr.
https://github.com/llvm/llvm-project/pull/226091
More information about the llvm-commits
mailing list