| 447 | } |
| 448 | |
| 449 | bool |
| 450 | Block::need_nested_loop(const CGContext& cg_context) |
| 451 | { |
| 452 | size_t i; |
| 453 | const Statement* s = get_last_stm(); |
| 454 | if (looping && (s == NULL || !s->must_jump()) && cg_context.rw_directive) { |
| 455 | RWDirective* rwd = cg_context.rw_directive; |
| 456 | for (i=0; i<rwd->must_read_vars.size(); i++) { |
| 457 | size_t dimen = rwd->must_read_vars[i]->get_dimension(); |
| 458 | if (dimen > cg_context.iv_bounds.size()) { |
| 459 | return true; |
| 460 | } else if (dimen == cg_context.iv_bounds.size() && rnd_flipcoin(10)) { |
| 461 | return true; |
| 462 | } |
| 463 | } |
| 464 | for (i=0; i<rwd->must_write_vars.size(); i++) { |
| 465 | size_t dimen = rwd->must_write_vars[i]->get_dimension(); |
| 466 | if (dimen > cg_context.iv_bounds.size()) { |
| 467 | return true; |
| 468 | } else if (dimen == cg_context.iv_bounds.size() && rnd_flipcoin(10)) { |
| 469 | return true; |
| 470 | } |
| 471 | } |
| 472 | } |
| 473 | return false; |
| 474 | } |
| 475 | |
| 476 | Statement* |
| 477 | Block::append_nested_loop(CGContext& cg_context) |
no test coverage detected