You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by kp...@apache.org on 2022/06/23 18:19:15 UTC

[tvm] branch main updated: [LLVM] Remove PrintModule (defined in llvm_common.cc) (#11851)

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 9968b73426 [LLVM] Remove PrintModule (defined in llvm_common.cc) (#11851)
9968b73426 is described below

commit 9968b73426d496d59dc3ebafd0437cf551d0407f
Author: Krzysztof Parzyszek <kp...@quicinc.com>
AuthorDate: Thu Jun 23 13:19:10 2022 -0500

    [LLVM] Remove PrintModule (defined in llvm_common.cc) (#11851)
    
    * [LLVM] Remove PrintModule (defined in llvm_common.cc)
    
    The only use of that function is commented out. `llvm::Module` can be
    printed directly to `llvm::raw_ostream` via <<, so it's quite easy to
    insert printing code when needed:
    ```
      std::string s;
      llvm::raw_string_ostream os(s);
      os << module;   // s (or os.str()) has the LLVM IR text
    ```
    
    * Restart CI
---
 src/target/llvm/codegen_llvm.cc | 1 -
 src/target/llvm/llvm_common.cc  | 7 -------
 src/target/llvm/llvm_common.h   | 2 --
 3 files changed, 10 deletions(-)

diff --git a/src/target/llvm/codegen_llvm.cc b/src/target/llvm/codegen_llvm.cc
index f56c6765a6..720347957b 100644
--- a/src/target/llvm/codegen_llvm.cc
+++ b/src/target/llvm/codegen_llvm.cc
@@ -319,7 +319,6 @@ void CodeGenLLVM::Optimize() {
     fpass.run(*it);
   }
   fpass.doFinalization();
-  // PrintModule(module_.get());
   mpass.run(*module_);
 }
 
diff --git a/src/target/llvm/llvm_common.cc b/src/target/llvm/llvm_common.cc
index f13e8563e0..06b2be2d9f 100644
--- a/src/target/llvm/llvm_common.cc
+++ b/src/target/llvm/llvm_common.cc
@@ -189,13 +189,6 @@ std::string LLVMTargetToString(const Target& target) {
   return os.str();
 }
 
-void PrintModule(const llvm::Module* mod) {
-  std::string modpe_str;
-  llvm::raw_string_ostream rso(modpe_str);
-  mod->print(rso, nullptr);
-  LOG(INFO) << rso.str();
-}
-
 }  // namespace codegen
 }  // namespace tvm
 #endif  // TVM_LLVM_VERSION
diff --git a/src/target/llvm/llvm_common.h b/src/target/llvm/llvm_common.h
index d59f3977cd..e11392be29 100644
--- a/src/target/llvm/llvm_common.h
+++ b/src/target/llvm/llvm_common.h
@@ -126,8 +126,6 @@ std::unique_ptr<llvm::TargetMachine> GetLLVMTargetMachine(const Target& target,
  */
 std::string LLVMTargetToString(const Target& target);
 
-void PrintModule(const llvm::Module* mod);
-
 }  // namespace codegen
 }  // namespace tvm