AMDGPU/SI: Emit constant variables in the .hsatext section when targeting HSA
[oota-llvm.git] / lib / Target / AMDGPU / AMDGPUAsmPrinter.cpp
index b4403432f3fc2458841ff42a8798ef293006d7c6..0b7477db2f3aa5fb2138886aeece4fb960ced423 100644 (file)
@@ -126,8 +126,12 @@ static bool isModuleLinkage(const GlobalValue *GV) {
 
 void AMDGPUAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
 
-  if (TM.getTargetTriple().getOS() != Triple::AMDHSA ||
-      GV->isDeclaration()) {
+  if (TM.getTargetTriple().getOS() != Triple::AMDHSA) {
+    AsmPrinter::EmitGlobalVariable(GV);
+    return;
+  }
+
+  if (GV->isDeclaration() || GV->getLinkage() == GlobalValue::PrivateLinkage) {
     AsmPrinter::EmitGlobalVariable(GV);
     return;
   }