4. Multiply the composed transformation matrix times the matrix form of the
loop.
5. Transform the newly created matrix (from step 4) back into a loop nest
- using fourier motzkin elimination to figure out the bounds. */
+ using Fourier-Motzkin elimination to figure out the bounds. */
static lambda_loopnest
lambda_compute_auxillary_space (lambda_loopnest nest,
lambda_matrix_add_mc (B, 1, B1, -1, B1, size, invariants);
/* Now compute the auxiliary space bounds by first inverting U, multiplying
- it by A1, then performing fourier motzkin. */
+ it by A1, then performing Fourier-Motzkin. */
invertedtrans = lambda_matrix_new (depth, depth);
/* Create a statement list and a linear expression temporary. */
stmts = alloc_stmt_list ();
resvar = create_tmp_var (type, "lbvtmp");
- add_referenced_tmp_var (resvar);
+ add_referenced_var (resvar);
/* Start at 0. */
stmt = build2 (MODIFY_EXPR, void_type_node, resvar, integer_zero_node);
/* Create a statement list and a linear expression temporary. */
stmts = alloc_stmt_list ();
resvar = create_tmp_var (type, "lletmp");
- add_referenced_tmp_var (resvar);
+ add_referenced_var (resvar);
/* Build up the linear expressions, and put the variable representing the
result in the results array. */
/* First, build the new induction variable temporary */
ivvar = create_tmp_var (type, "lnivtmp");
- add_referenced_tmp_var (ivvar);
+ add_referenced_var (ivvar);
VEC_safe_push (tree, heap, new_ivs, ivvar);
/* Create the new iv. */
oldivvar = VEC_index (tree, loopivs, 0);
ivvar = create_tmp_var (TREE_TYPE (oldivvar), "perfectiv");
- add_referenced_tmp_var (ivvar);
+ add_referenced_var (ivvar);
standard_iv_increment_position (newloop, &bsi, &insert_after);
create_iv (VEC_index (tree, lbounds, 0),
build_int_cst (TREE_TYPE (oldivvar), VEC_index (int, steps, 0)),
exit_condition = get_loop_exit_condition (newloop);
uboundvar = create_tmp_var (integer_type_node, "uboundvar");
- add_referenced_tmp_var (uboundvar);
+ add_referenced_var (uboundvar);
stmt = build2 (MODIFY_EXPR, void_type_node, uboundvar,
VEC_index (tree, ubounds, 0));
uboundvar = make_ssa_name (uboundvar, stmt);
if (dominated_by_p (CDI_DOMINATORS, loop->inner->header, bbs[i]))
{
- for (bsi = bsi_last (bbs[i]); !bsi_end_p (bsi);)
+ block_stmt_iterator header_bsi
+ = bsi_after_labels (loop->inner->header);
+
+ for (bsi = bsi_start (bbs[i]); !bsi_end_p (bsi);)
{
- use_operand_p use_p;
- imm_use_iterator imm_iter;
- tree imm_stmt;
tree stmt = bsi_stmt (bsi);
if (stmt == exit_condition
|| not_interesting_stmt (stmt)
|| stmt_is_bumper_for_loop (loop, stmt))
{
- if (!bsi_end_p (bsi))
- bsi_prev (&bsi);
+ bsi_next (&bsi);
continue;
}
-
- /* Make copies of this statement to put it back next
- to its uses. */
- FOR_EACH_IMM_USE_STMT (imm_stmt, imm_iter,
- TREE_OPERAND (stmt, 0))
- {
- if (!exit_phi_for_loop_p (loop->inner, imm_stmt))
- {
- block_stmt_iterator tobsi;
- tree newname;
- tree newstmt;
-
- newstmt = unshare_expr (stmt);
- tobsi = bsi_after_labels (bb_for_stmt (imm_stmt));
- newname = TREE_OPERAND (newstmt, 0);
- newname = SSA_NAME_VAR (newname);
- newname = make_ssa_name (newname, newstmt);
- TREE_OPERAND (newstmt, 0) = newname;
-
- FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter)
- SET_USE (use_p, newname);
-
- bsi_insert_before (&tobsi, newstmt, BSI_SAME_STMT);
- update_stmt (newstmt);
- update_stmt (imm_stmt);
- }
- }
- if (!bsi_end_p (bsi))
- bsi_prev (&bsi);
+
+ bsi_move_before (&bsi, &header_bsi);
}
}
else