aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-data-ref.h
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2010-08-24 23:35:48 +0000
committerSebastian Pop <spop@gcc.gnu.org>2010-08-24 23:35:48 +0000
commitbd544141e09187ded0b02cac4ee5ce56ca38622c (patch)
tree98e3e8412290ce628f63d66548ba9b9cdb10c1ca /gcc/tree-data-ref.h
parent3a9abc98c235676b9268f9bce3ee37a50266557d (diff)
downloadgcc-bd544141e09187ded0b02cac4ee5ce56ca38622c.zip
gcc-bd544141e09187ded0b02cac4ee5ce56ca38622c.tar.gz
gcc-bd544141e09187ded0b02cac4ee5ce56ca38622c.tar.bz2
Add flag -ftree-loop-if-convert-stores.
This patch adds a flag that controls the replacement of the memory writes that are in predicated basic blocks with a full write: for (...) if (cond) A[i] = foo is replaced with: for (...) A[i] = cond ? foo : A[i] In order to do this, we have to call gimple_could_trap_p instead of gimple_assign_rhs_could_trap_p, as we have to also check that the LHS of assign stmts does not trap. * common.opt (ftree-loop-if-convert-stores): New flag. * doc/invoke.texi (ftree-loop-if-convert-stores): Documented. * tree-if-conv.c (ifc_temp_var): Pass an extra parameter GSI. Insert the created statement before GSI. (if_convertible_phi_p): Allow virtual phi nodes when flag_loop_if_convert_stores is set. (if_convertible_gimple_assign_stmt_p): Allow memory reads and writes Do not handle types that do not match is_gimple_reg_type. Remove loop and bb parameters. Call gimple_could_trap_p instead of when flag_loop_if_convert_stores is set, as LHS can contain memory refs. (if_convertible_stmt_p): Remove loop and bb parameters. Update calls to if_convertible_gimple_assign_stmt_p. (if_convertible_loop_p): Update call to if_convertible_stmt_p. (replace_phi_with_cond_gimple_assign_stmt): Renamed predicate_scalar_phi. Do not handle virtual phi nodes. (ifconvert_phi_nodes): Renamed predicate_all_scalar_phis. Call predicate_scalar_phi. (insert_gimplified_predicates): Insert the gimplified predicate of a BB just after the labels for flag_loop_if_convert_stores, otherwise insert the predicate in the end of the BB. (predicate_mem_writes): New. (combine_blocks): Call predicate_all_scalar_phis. When flag_loop_if_convert_stores is set, call predicate_mem_writes. (tree_if_conversion): Call mark_sym_for_renaming when flag_loop_if_convert_stores is set. (main_tree_if_conversion): Return TODO_update_ssa_only_virtuals when flag_loop_if_convert_stores is set. * gcc.dg/tree-ssa/ifc-4.c: New. * gcc.dg/tree-ssa/ifc-7.c: New. From-SVN: r163530
Diffstat (limited to 'gcc/tree-data-ref.h')
0 files changed, 0 insertions, 0 deletions