Mercurial > octave-nkf
diff src/pt-eval.cc @ 15027:741d2dbcc117
Check trip count before compiling for loops.
* src/jit-typeinfo.cc (octave_jit_cast_any_range, octave_jit_cast_range_any):
New function.
(octave_jit_paren_subsasgn_impl): Add return argument.
(jit_typeinfo::jit_typeinfo): Update octave_jit_paren_subsasgn_impl call and add
any <-> range casts.
* src/pt-eval.cc (tree_evaluator::visit_simple_for_command): Try jit after
computing loop bounds.
* src/pt-jit.cc (jit_convert::jit_convert): Add and handle for bounds argument.
(jit_convert::visit_binary_expression): Use next_shortcircut_result.
(jit_convert::visit_simple_for_command): Use next_iterator and check for
precomputed bounds.
(jit_convert::find_variable, jit_convert::create_variable,
jit_convert::next_name, tree_jit::trip_count, jit_info::initialize,
jit_info::find): New function.
(jit_convert::get_variable): Use find_variable and create_variable.
(tree_jit::execute): Allow for precomputed loop bounds and check trip count.
(jit_info::jit_info): Added new overload and defer work to initialize.
(jit_info::execute): Support precomputed bounds.
(jit_info::match): Support precomputed bounds.
* src/pt-jit.h (jit_convert::jit_convert, jit_convert::execute,
jit_info::execute, jit_info::match): New parameter.
(jit_convert::find_variable, jit_convert::create_variable,
tree_jit::trip_count, jit_info::initialize, jit_info::find): New declaration.
(jit_convert::next_iterator, jit_convert::next_for_bounds,
jit_convert::next_shortcircut_result, jit_convert::next_name): New function.
author | Max Brister <max@2bass.com> |
---|---|
date | Thu, 26 Jul 2012 17:03:15 -0500 |
parents | 75d1bc2fd6d2 |
children | a820a990968e |
line wrap: on
line diff
--- a/src/pt-eval.cc Mon Jul 23 12:18:07 2012 +0400 +++ b/src/pt-eval.cc Thu Jul 26 17:03:15 2012 -0500 @@ -296,11 +296,6 @@ if (debug_mode) do_breakpoint (cmd.is_breakpoint ()); -#if HAVE_LLVM - if (jiter.execute (cmd)) - return; -#endif - // FIXME -- need to handle PARFOR loops here using cmd.in_parallel () // and cmd.maxproc_expr (); @@ -314,6 +309,11 @@ octave_value rhs = expr->rvalue1 (); +#if HAVE_LLVM + if (jiter.execute (cmd, rhs)) + return; +#endif + if (error_state || rhs.is_undefined ()) return;