[NVPTX] Variables that start with llvm. or nvvm. are reserved and should not be emitted
authorJustin Holewinski <jholewinski@nvidia.com>
Fri, 27 Jun 2014 18:35:53 +0000 (18:35 +0000)
committerJustin Holewinski <jholewinski@nvidia.com>
Fri, 27 Jun 2014 18:35:53 +0000 (18:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211940 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/NVPTX/NVPTXAsmPrinter.cpp

index 34de7bbd8a6a418765206f60afe831875ce78c7e..652a4995569e6de494a0a53f4444f03a3ca85a1c 100644 (file)
@@ -1351,6 +1351,11 @@ void NVPTXAsmPrinter::printModuleLevelGV(const GlobalVariable *GVar,
       return;
   }
 
+  // Skip LLVM intrinsic global variables
+  if (GVar->getName().startswith("llvm.") ||
+      GVar->getName().startswith("nvvm."))
+    return;
+
   const DataLayout *TD = TM.getDataLayout();
 
   // GlobalVariables are always constant pointers themselves.