This revision was automatically updated to reflect the committed changes. Closed by commit rG57a210e5b705: [CUDA][HIP] Fix linkage of __clang_gpu_used_external (authored by yaxunl). Herald added a project: clang.
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124466/new/ https://reviews.llvm.org/D124466 Files: clang/lib/CodeGen/CodeGenModule.cpp clang/test/CodeGenCUDA/host-used-extern.cu Index: clang/test/CodeGenCUDA/host-used-extern.cu =================================================================== --- clang/test/CodeGenCUDA/host-used-extern.cu +++ clang/test/CodeGenCUDA/host-used-extern.cu @@ -11,7 +11,7 @@ #include "Inputs/cuda.h" -// CHECK-LABEL: @__clang_gpu_used_external = appending {{.*}}global +// CHECK-LABEL: @__clang_gpu_used_external = internal {{.*}}global // CHECK-DAG: @_Z7kernel1v // CHECK-DAG: @_Z7kernel4v // CHECK-DAG: @var1 Index: clang/lib/CodeGen/CodeGenModule.cpp =================================================================== --- clang/lib/CodeGen/CodeGenModule.cpp +++ clang/lib/CodeGen/CodeGenModule.cpp @@ -598,7 +598,7 @@ llvm::ArrayType *ATy = llvm::ArrayType::get(Int8PtrTy, UsedArray.size()); auto *GV = new llvm::GlobalVariable( - getModule(), ATy, false, llvm::GlobalValue::AppendingLinkage, + getModule(), ATy, false, llvm::GlobalValue::InternalLinkage, llvm::ConstantArray::get(ATy, UsedArray), "__clang_gpu_used_external"); addCompilerUsedGlobal(GV); }
Index: clang/test/CodeGenCUDA/host-used-extern.cu =================================================================== --- clang/test/CodeGenCUDA/host-used-extern.cu +++ clang/test/CodeGenCUDA/host-used-extern.cu @@ -11,7 +11,7 @@ #include "Inputs/cuda.h" -// CHECK-LABEL: @__clang_gpu_used_external = appending {{.*}}global +// CHECK-LABEL: @__clang_gpu_used_external = internal {{.*}}global // CHECK-DAG: @_Z7kernel1v // CHECK-DAG: @_Z7kernel4v // CHECK-DAG: @var1 Index: clang/lib/CodeGen/CodeGenModule.cpp =================================================================== --- clang/lib/CodeGen/CodeGenModule.cpp +++ clang/lib/CodeGen/CodeGenModule.cpp @@ -598,7 +598,7 @@ llvm::ArrayType *ATy = llvm::ArrayType::get(Int8PtrTy, UsedArray.size()); auto *GV = new llvm::GlobalVariable( - getModule(), ATy, false, llvm::GlobalValue::AppendingLinkage, + getModule(), ATy, false, llvm::GlobalValue::InternalLinkage, llvm::ConstantArray::get(ATy, UsedArray), "__clang_gpu_used_external"); addCompilerUsedGlobal(GV); }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits