[Comgr] Link with TransformUtils that defines llvm::CloneFunction#2483
Conversation
With BUILD_SHARED_LIBS, compilation would fail with: /usr/bin/ld: tools/comgr/CMakeFiles/amd_comgr.dir/src/comgr-compiler.cpp.o: in function `COMGR::AMDGPUCompiler::cloneKernelsInBitcode(COMGR::DataSet*)': /home/juamarti/llvm/_llvm/amd/comgr/src/comgr-compiler.cpp:2588: undefined reference to `llvm::CloneFunction(llvm::Function*, llvm::ValueMap<llvm::Value const*, llvm::WeakTrackingVH, llvm::ValueMapConfig<llvm::Value const*, llvm::sys::SmartMutex<false> > >&, llvm::ClonedCodeInfo*)'
|
In the past I tried using CloneModule for something and it was incredibly slow. Not sure if cloneFunction has the same issues, but something to keep an eye out for |
AFAIK It's used when translating spirv to bitcode. When we have several block-sizes specified in the action, we have to specialize the translated kernel for every size. I wonder if this is often used with a single block-size. In that case we could avoid the clone and reuse the kernels that already exist. @steffenlarsen do you have more context about this? |
With
BUILD_SHARED_LIBS, compilation would fail with: