[PATCH] D104730: [MCA] [AMDGPU] Adding CustomBehaviour implementation for AMDGPU.

Tom Stellard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 7 20:38:47 PDT 2021


tstellar added a comment.

It looks like this patch is causing build failures with -DLLVM_BUILD_LLVM_DYLIB=ON and -DLLVM_LINK_LLVM_DYLIB=ON.  I think the problem is that it's trying to access AMDGPU symbols from libLLVM-13.so which are not exported in the shared library build.  If you need to use these symbols, then I think the only solution is to pass DISABLE_LLVM_LINK_LLVM_DYLIB to add_llvm_library() in /llvm/tools/llvm-mca/lib/AMDGPU/CMakeLists.txt

Here is the full failure log:
/usr/bin/g++ -O2  -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -O2 -g -DNDEBUG -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld    -Wl,-rpath-link,/builddir/build/BUILD/llvm-13.0.0.src/x86_64-redhat-linux-gnu/./lib64  -Wl,-O3 -Wl,--gc-sections tools/llvm-mca/CMakeFiles/llvm-mca.dir/llvm-mca.cpp.o tools/llvm-mca/CMakeFiles/llvm-mca.dir/CodeRegion.cpp.o tools/llvm-mca/CMakeFiles/llvm-mca.dir/CodeRegionGenerator.cpp.o tools/llvm-mca/CMakeFiles/llvm-mca.dir/PipelinePrinter.cpp.o tools/llvm-mca/CMakeFiles/llvm-mca.dir/Views/BottleneckAnalysis.cpp.o tools/llvm-mca/CMakeFiles/llvm-mca.dir/Views/DispatchStatistics.cpp.o tools/llvm-mca/CMakeFiles/llvm-mca.dir/Views/InstructionInfoView.cpp.o tools/llvm-mca/CMakeFiles/llvm-mca.dir/Views/InstructionView.cpp.o tools/llvm-mca/CMakeFiles/llvm-mca.dir/Views/RegisterFileStatistics.cpp.o tools/llvm-mca/CMakeFiles/llvm-mca.dir/Views/ResourcePressureView.cpp.o tools/llvm-mca/CMakeFiles/llvm-mca.dir/Views/RetireControlUnitStatistics.cpp.o tools/llvm-mca/CMakeFiles/llvm-mca.dir/Views/SchedulerStatistics.cpp.o tools/llvm-mca/CMakeFiles/llvm-mca.dir/Views/SummaryView.cpp.o tools/llvm-mca/CMakeFiles/llvm-mca.dir/Views/TimelineView.cpp.o tools/llvm-mca/CMakeFiles/llvm-mca.dir/Views/View.cpp.o -o bin/llvm-mca  -lpthread  lib64/libLLVMMCACustomBehaviourAMDGPU.a  lib64/libLLVM-13.so && :
/usr/bin/ld: lib64/libLLVMMCACustomBehaviourAMDGPU.a(AMDGPUCustomBehaviour.cpp.o): in function `llvm::mca::AMDGPUCustomBehaviour::computeWaitCnt(llvm::mca::InstRef const&, unsigned int&, unsigned int&, unsigned int&, unsigned int&)':
/builddir/build/BUILD/llvm-13.0.0.src/x86_64-redhat-linux-gnu/../tools/llvm-mca/lib/AMDGPU/AMDGPUCustomBehaviour.cpp:222: undefined reference to `llvm::AMDGPU::decodeWaitcnt(llvm::AMDGPU::IsaVersion const&, unsigned int, unsigned int&, unsigned int&, unsigned int&)'
/usr/bin/ld: lib64/libLLVMMCACustomBehaviourAMDGPU.a(AMDGPUCustomBehaviour.cpp.o): in function `llvm::mca::AMDGPUCustomBehaviour::hasModifiersSet(std::unique_ptr<llvm::mca::Instruction, std::default_delete<llvm::mca::Instruction> > const&, unsigned int) const':
/builddir/build/BUILD/llvm-13.0.0.src/x86_64-redhat-linux-gnu/../tools/llvm-mca/lib/AMDGPU/AMDGPUCustomBehaviour.cpp:308: undefined reference to `llvm::AMDGPU::getNamedOperandIdx(unsigned short, unsigned short)'
/usr/bin/ld: lib64/libLLVMMCACustomBehaviourAMDGPU.a(AMDGPUCustomBehaviour.cpp.o): in function `llvm::mca::AMDGPUCustomBehaviour::generateWaitCntInfo()':
/builddir/build/BUILD/llvm-13.0.0.src/x86_64-redhat-linux-gnu/../tools/llvm-mca/lib/AMDGPU/AMDGPUCustomBehaviour.cpp:263: undefined reference to `llvm::AMDGPU::getMUBUFIsBufferInv(unsigned int)'
collect2: error: ld returned 1 exit status


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104730/new/

https://reviews.llvm.org/D104730



More information about the llvm-commits mailing list