diff options
| author | Alex Zinenko <zinenko@google.com> | 2019-12-02 03:27:38 -0800 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-12-02 03:28:10 -0800 |
| commit | d5e627f84b440cb4dd30802930629ea970dd4342 (patch) | |
| tree | 13d3a929445b6e260759eb3ecdc92a247225c08f /mlir/lib/Conversion/GPUToCUDA | |
| parent | 2235333d5878393ca4d43891184c3f58f71edeb5 (diff) | |
| download | bcm5719-llvm-d5e627f84b440cb4dd30802930629ea970dd4342.tar.gz bcm5719-llvm-d5e627f84b440cb4dd30802930629ea970dd4342.zip | |
Introduce Linkage attribute to the LLVM dialect
LLVM IR supports linkage on global objects such as global variables and
functions. Introduce the Linkage attribute into the LLVM dialect, backed by an
integer storage. Use this attribute on LLVM::GlobalOp and make it mandatory.
Implement parsing/printing of the attribute and conversion to LLVM IR.
See tensorflow/mlir#277.
PiperOrigin-RevId: 283309328
Diffstat (limited to 'mlir/lib/Conversion/GPUToCUDA')
| -rw-r--r-- | mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp b/mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp index 9d8c8942051..f342083bee7 100644 --- a/mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp +++ b/mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp @@ -320,7 +320,7 @@ Value *GpuLaunchFuncToCudaCallsPass::generateKernelNameConstant( std::string globalName = llvm::formatv("{0}_kernel_name", name); return LLVM::createGlobalString( loc, builder, globalName, StringRef(kernelName.data(), kernelName.size()), - llvmDialect); + LLVM::Linkage::Internal, llvmDialect); } // Emits LLVM IR to launch a kernel function. Expects the module that contains @@ -368,7 +368,8 @@ void GpuLaunchFuncToCudaCallsPass::translateGpuLaunchCalls( SmallString<128> nameBuffer(*kernelModule.getName()); nameBuffer.append(kCubinStorageSuffix); Value *data = LLVM::createGlobalString( - loc, builder, nameBuffer.str(), cubinAttr.getValue(), getLLVMDialect()); + loc, builder, nameBuffer.str(), cubinAttr.getValue(), + LLVM::Linkage::Internal, getLLVMDialect()); // Emit the load module call to load the module data. Error checking is done // in the called helper function. |

