================
@@ -1484,13 +1485,11 @@ 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()) {
-      O << "\t.reg .b64 \t%SP;\n"
-        << "\t.reg .b64 \t%SPL;\n";
-    } else {
-      O << "\t.reg .b32 \t%SP;\n"
-        << "\t.reg .b32 \t%SPL;\n";
-    }
+    if (static_cast<const NVPTXTargetMachine &>(MF.getTarget())
+            .getPointerSize(ADDRESS_SPACE_LOCAL) == 8)
+      O << "\t.reg .b64 \t%SPL;\n";
+    else
+      O << "\t.reg .b32 \t%SPL;\n";
----------------
AlexMaclean wrote:

Nit: lets just use getPointerSizeInBits and print that value directly. 

https://github.com/llvm/llvm-project/pull/154814
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to