diff options
author | River Riddle <riverriddle@google.com> | 2019-07-01 10:29:09 -0700 |
---|---|---|
committer | jpienaar <jpienaar@google.com> | 2019-07-01 11:39:00 -0700 |
commit | 54cd6a7e97a226738e2c85b86559918dd9e3cd5d (patch) | |
tree | affa803347d6695be575137d1ad55a055a8021e3 /mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp | |
parent | 84bd67fc4fd116e80f7a66bfadfe9a7fd6fd5e82 (diff) | |
download | bcm5719-llvm-54cd6a7e97a226738e2c85b86559918dd9e3cd5d.tar.gz bcm5719-llvm-54cd6a7e97a226738e2c85b86559918dd9e3cd5d.zip |
NFC: Refactor Function to be value typed.
Move the data members out of Function and into a new impl storage class 'FunctionStorage'. This allows for Function to become value typed, which will greatly simplify the transition of Function to FuncOp(given that FuncOp is also value typed).
PiperOrigin-RevId: 255983022
Diffstat (limited to 'mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp')
-rw-r--r-- | mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp b/mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp index 9d7aeeb6321..022d8c70cc6 100644 --- a/mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp +++ b/mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp @@ -64,8 +64,8 @@ public: LLVMInitializeNVPTXTargetMC(); LLVMInitializeNVPTXAsmPrinter(); - for (auto &function : getModule()) { - if (!gpu::GPUDialect::isKernel(&function) || function.isExternal()) { + for (auto function : getModule()) { + if (!gpu::GPUDialect::isKernel(function) || function.isExternal()) { continue; } if (failed(translateGpuKernelToCubinAnnotation(function))) @@ -142,7 +142,7 @@ GpuKernelToCubinPass::translateGpuKernelToCubinAnnotation(Function &function) { std::unique_ptr<Module> module(builder.createModule()); // TODO(herhut): Also handle called functions. - module->getFunctions().push_back(function.clone()); + module->push_back(function.clone()); auto llvmModule = translateModuleToNVVMIR(*module); auto cubin = convertModuleToCubin(*llvmModule, function); |