# HG changeset patch # User Max Brister # Date 1347314530 18000 # Node ID 6bdf379592d91fe2cb153b1708843c11ec397a7f # Parent bd906ac220b625f89388c6d3420ac4a0ede4db3d Remove --enable-jit-debug configure option * configure.ac: Remove --enable-jit-debug option. * pt-jit.cc: REmove OCTAVE_JIT_DEBUG guards. diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -693,13 +693,6 @@ ## Find llvm-config program from environment variable or by searching AC_ARG_VAR([LLVM_CONFIG], [path to llvm-config utility]) AC_CHECK_PROG([LLVM_CONFIG], llvm-config, llvm-config, []) - - AC_ARG_ENABLE([jit-debug], - [AS_HELP_STRING([--enable-jit-debug], [enable debug printing of JIT IRs])]) - - if test x$enable_jit_debug = "xyes"; then - AC_DEFINE(OCTAVE_JIT_DEBUG, 1, [Define to 1 for JIT debug printing.]) - fi if test -z "$LLVM_CONFIG"; then warn_llvm="llvm-config utility not found. JIT compiler is disabled." diff --git a/libinterp/interp-core/pt-jit.cc b/libinterp/interp-core/pt-jit.cc --- a/libinterp/interp-core/pt-jit.cc +++ b/libinterp/interp-core/pt-jit.cc @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -55,10 +56,6 @@ #include #include -#ifdef OCTAVE_JIT_DEBUG -#include -#endif - static llvm::IRBuilder<> builder (llvm::getGlobalContext ()); static llvm::LLVMContext& context = llvm::getGlobalContext (); @@ -1865,12 +1862,13 @@ module_pass_manager->run (*module); pass_manager->run (*fn); -#ifdef OCTAVE_JIT_DEBUG - std::string error; - llvm::raw_fd_ostream fout ("test.bc", error, - llvm::raw_fd_ostream::F_Binary); - llvm::WriteBitcodeToFile (module, fout); -#endif + if (Venable_jit_debug) + { + std::string error; + llvm::raw_fd_ostream fout ("test.bc", error, + llvm::raw_fd_ostream::F_Binary); + llvm::WriteBitcodeToFile (module, fout); + } } // -------------------- jit_function_info -------------------- @@ -1890,7 +1888,6 @@ conv.get_variable_map ()); infer.infer (); -#if OCTAVE_JIT_DEBUG if (Venable_jit_debug) { jit_block_list& blocks = infer.get_blocks (); @@ -1905,7 +1902,6 @@ tpc.visit_octave_user_function_trailer (fcn); blocks.print (std::cout, "octave jit ir"); } -#endif jit_factory& factory = conv.get_factory (); llvm::Module *module = tjit.get_module (); @@ -1915,7 +1911,6 @@ factory.constants (), fcn, argument_types); -#ifdef OCTAVE_JIT_DEBUG if (Venable_jit_debug) { std::cout << "-------------------- raw function "; @@ -1923,7 +1918,6 @@ std::cout << *raw_fn.to_llvm () << std::endl; llvm::verifyFunction (*raw_fn.to_llvm ()); } -#endif std::string wrapper_name = fcn.name () + "_wrapper"; jit_type *any_t = jit_typeinfo::get_any (); @@ -1964,7 +1958,6 @@ llvm::Function *llvm_function = wrapper.to_llvm (); tjit.optimize (llvm_function); -#ifdef OCTAVE_JIT_DEBUG if (Venable_jit_debug) { std::cout << "-------------------- optimized and wrapped "; @@ -1972,7 +1965,6 @@ std::cout << *llvm_function << std::endl; llvm::verifyFunction (*llvm_function); } -#endif llvm::ExecutionEngine* engine = tjit.get_engine (); void *void_fn = engine->getPointerToFunction (llvm_function); @@ -1981,13 +1973,12 @@ catch (const jit_fail_exception& e) { argument_types.clear (); -#ifdef OCTAVE_JIT_DEBUG + if (Venable_jit_debug) { if (e.known ()) std::cout << "jit fail: " << e.what () << std::endl; } -#endif } } @@ -2113,7 +2104,7 @@ conv.get_variable_map ()); infer.infer (); -#ifdef OCTAVE_JIT_DEBUG + if (Venable_jit_debug) { jit_block_list& blocks = infer.get_blocks (); @@ -2123,7 +2114,6 @@ std::cout << tee.str_print_code () << std::endl; blocks.print (std::cout, "octave jit ir"); } -#endif jit_factory& factory = conv.get_factory (); jit_convert_llvm to_llvm; @@ -2135,41 +2125,30 @@ } catch (const jit_fail_exception& e) { -#ifdef OCTAVE_JIT_DEBUG if (Venable_jit_debug) { if (e.known ()) std::cout << "jit fail: " << e.what () << std::endl; } -#endif } if (llvm_function) { -#ifdef OCTAVE_JIT_DEBUG - llvm::raw_os_ostream llvm_cout (std::cout); - if (Venable_jit_debug) { std::cout << "-------------------- llvm ir --------------------"; - llvm_function->print (llvm_cout); - std::cout << std::endl; + std::cout << *llvm_function << std::endl; llvm::verifyFunction (*llvm_function); } -#endif tjit.optimize (llvm_function); -#ifdef OCTAVE_JIT_DEBUG if (Venable_jit_debug) { std::cout << "-------------------- optimized llvm ir " << "--------------------\n"; - llvm_function->print (llvm_cout); - llvm_cout.flush (); - std::cout << std::endl; + std::cout << *llvm_function << std::endl; } -#endif void *void_fn = engine->getPointerToFunction (llvm_function); function = reinterpret_cast (void_fn); @@ -2193,7 +2172,7 @@ debugging/tracing is enabled for Octave's JIT compiler.\n\ @end deftypefn") { -#if defined (HAVE_LLVM) && defined (OCTAVE_JIT_DEBUG) +#if defined (HAVE_LLVM) return SET_INTERNAL_VARIABLE (enable_jit_debug); #else warning ("enable_jit_debug: JIT compiling not available in this version of Octave");