Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug][LLVM] TVM fails to compile with LLVM 17 #14313

Closed
supersat opened this issue Mar 15, 2023 · 1 comment
Closed

[Bug][LLVM] TVM fails to compile with LLVM 17 #14313

supersat opened this issue Mar 15, 2023 · 1 comment
Labels
needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug

Comments

@supersat
Copy link
Contributor

supersat commented Mar 15, 2023

This is mostly an FYI/early warning that LLVM 17 seems to have introduced breaking changes.

Expected behavior

TVM compiles as expected.

Actual behavior

The following errors were emitted:

/home/kkoscher/Projects/tvm/src/target/llvm/codegen_amdgpu.cc:45:10: fatal error: 'llvm/Transforms/IPO/PassManagerBuilder.h' file not found
#include <llvm/Transforms/IPO/PassManagerBuilder.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 /home/kkoscher/Projects/tvm/src/target/llvm/codegen_nvptx.cc:48:10: fatal error: 'llvm/Transforms/IPO/PassManagerBuilder.h' file not found
#include <llvm/Transforms/IPO/PassManagerBuilder.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Other LLVM deprecation warnings are also emitted:

/home/kkoscher/Projects/tvm/src/target/llvm/codegen_blob.cc:112:64: warning: 'getABITypeAlignment' is deprecated: use getABITypeAlign instead [-Wdeprecated-declarations]
    auto tvm_dev_mblob_reg_alignment = module->getDataLayout().getABITypeAlignment(int32_ty);
                                                               ^~~~~~~~~~~~~~~~~~~
                                                               getABITypeAlign
/home/kkoscher/Projects/llvm-project/llvm/include/llvm/IR/DataLayout.h:519:3: note: 'getABITypeAlignment' has been explicitly marked deprecated here
  LLVM_DEPRECATED("use getABITypeAlign instead", "getABITypeAlign")
  ^
/home/kkoscher/Projects/llvm-project/llvm/include/llvm/Support/Compiler.h:143:50: note: expanded from macro 'LLVM_DEPRECATED'
#define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
                                                 ^

/home/kkoscher/Projects/tvm/src/target/llvm/codegen_hexagon.cc:89:50: warning: 'getFixedSize' is deprecated: Use getFixedValue() instead [-Wdeprecated-declarations]
    return data_layout_->getTypeSizeInBits(type).getFixedSize();
                                                 ^~~~~~~~~~~~
                                                 getFixedValue
/home/kkoscher/Projects/llvm-project/llvm/include/llvm/Support/TypeSize.h:338:3: note: 'getFixedSize' has been explicitly marked deprecated here
  LLVM_DEPRECATED("Use getFixedValue() instead", "getFixedValue")
  ^
/home/kkoscher/Projects/llvm-project/llvm/include/llvm/Support/Compiler.h:143:50: note: expanded from macro 'LLVM_DEPRECATED'
#define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))

Environment

OS: Ubuntu 20.04
TVM hash: eecc02ad358367bacf461a7b0676231a1be6b6c3
llvm-project hash: 0b70f95c162634a06783081c6eda46d12cbcfd02

Steps to reproduce

Since LLVM 17 is currently in development, you must build LLVM 17 from source.

I used the following commands to build LLVM:

cmake -S llvm -B build -G Ninja -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_PARALLEL_LINK_JOBS=1

cmake --build build

When building TVM, I run cmake with -DUSE_LLVM and -DCMAKE_CXX_COMPILER point to my built LLVM and Clang++ repsectively.

Triage

  • needs-triage
  • backend: llvm
  • backend: nvptx

This also seems to affect AMD GPU (missing header) and Hexagon codegen (deprecation warnings).

@supersat supersat added needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug labels Mar 15, 2023
@supersat
Copy link
Contributor Author

supersat commented Apr 6, 2023

Resolved by #14469

@supersat supersat closed this as completed Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug
Projects
None yet
Development

No branches or pull requests

1 participant