This is an automated email from the ASF dual-hosted git repository.

kparzysz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new f7c2bbbe87 [LLVM] Fix registerCallbacks API after recent change 
(#14323)
f7c2bbbe87 is described below

commit f7c2bbbe87bdcb005f4bd918d96fe783a25578d3
Author: Anirudh Sundar Subramaniam <quic_sanir...@quicinc.com>
AuthorDate: Fri Mar 17 19:39:17 2023 +0530

    [LLVM] Fix registerCallbacks API after recent change (#14323)
    
    LLVM upstream recently changed their API for registerCallbacks in
    https://reviews.llvm.org/D146160 and this causes an error while building
---
 src/target/llvm/codegen_llvm.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/target/llvm/codegen_llvm.cc b/src/target/llvm/codegen_llvm.cc
index ee5a6796c9..dd9c3ddb5b 100644
--- a/src/target/llvm/codegen_llvm.cc
+++ b/src/target/llvm/codegen_llvm.cc
@@ -398,7 +398,11 @@ void CodeGenLLVM::Optimize() {
   }
 
   llvm::StandardInstrumentations si(*llvm_target_->GetContext(), 
debug_logging, verify_each);
+#if LLVM_VERSION_MAJOR >= 17
+  si.registerCallbacks(pic, &mam);
+#else
   si.registerCallbacks(pic, &fam);
+#endif
   llvm::ModulePassManager mpass;
   if (verify_each) {
     mpass.addPass(llvm::VerifierPass());

Reply via email to