[llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

Alex MacLean via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 21 11:40:14 PDT 2025


================
@@ -1484,7 +1484,8 @@ void NVPTXAsmPrinter::setAndEmitFunctionVirtualRegisters(
   if (NumBytes) {
     O << "\t.local .align " << MFI.getMaxAlign().value() << " .b8 \t"
       << DEPOTNAME << getFunctionNumber() << "[" << NumBytes << "];\n";
-    if (static_cast<const NVPTXTargetMachine &>(MF.getTarget()).is64Bit()) {
+    if (static_cast<const NVPTXTargetMachine &>(MF.getTarget())
+            .getPointerSize(ADDRESS_SPACE_LOCAL) == 8) {
----------------
AlexMaclean wrote:

This doesn't look right to me. The size of `%SP` should be the size of a generic pointer while the size of `%SPL` should be the size of a local pointer. What you have here will use the size of a local pointer for both. 

https://github.com/llvm/llvm-project/pull/154814


More information about the llvm-commits mailing list