Mercurial > octave-nkf
comparison 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 |
comparison
equal
deleted
inserted
replaced
15026:ae42d5a67ed9 | 15027:741d2dbcc117 |
---|---|
294 return; | 294 return; |
295 | 295 |
296 if (debug_mode) | 296 if (debug_mode) |
297 do_breakpoint (cmd.is_breakpoint ()); | 297 do_breakpoint (cmd.is_breakpoint ()); |
298 | 298 |
299 // FIXME -- need to handle PARFOR loops here using cmd.in_parallel () | |
300 // and cmd.maxproc_expr (); | |
301 | |
302 unwind_protect frame; | |
303 | |
304 frame.protect_var (in_loop_command); | |
305 | |
306 in_loop_command = true; | |
307 | |
308 tree_expression *expr = cmd.control_expr (); | |
309 | |
310 octave_value rhs = expr->rvalue1 (); | |
311 | |
299 #if HAVE_LLVM | 312 #if HAVE_LLVM |
300 if (jiter.execute (cmd)) | 313 if (jiter.execute (cmd, rhs)) |
301 return; | 314 return; |
302 #endif | 315 #endif |
303 | |
304 // FIXME -- need to handle PARFOR loops here using cmd.in_parallel () | |
305 // and cmd.maxproc_expr (); | |
306 | |
307 unwind_protect frame; | |
308 | |
309 frame.protect_var (in_loop_command); | |
310 | |
311 in_loop_command = true; | |
312 | |
313 tree_expression *expr = cmd.control_expr (); | |
314 | |
315 octave_value rhs = expr->rvalue1 (); | |
316 | 316 |
317 if (error_state || rhs.is_undefined ()) | 317 if (error_state || rhs.is_undefined ()) |
318 return; | 318 return; |
319 | 319 |
320 { | 320 { |