aboutsummaryrefslogtreecommitdiff
path: root/gcc/graphite-sese-to-poly.c
AgeCommit message (Collapse)AuthorFilesLines
2011-01-25Only copy PBB_DOMAIN when it is initialized.Sebastian Pop1-2/+4
2011-01-25 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (new_pbb_from_pbb): Only copy PBB_DOMAIN when it is initialized. * gfortran.dg/graphite/id-23.f: New. From-SVN: r169219
2011-01-25Pass to dr_analyze_indices the analysis loop for subscripts.Sebastian Pop1-7/+53
2011-01-25 Sebastian Pop <sebastian.pop@amd.com> * graphite-scop-detection.c (stmt_has_simple_data_refs_p): Update call to graphite_find_data_references_in_stmt. * graphite-sese-to-poly.c (outermost_loop_in_sese_1): New. (try_generate_gimple_bb): Call outermost_loop_in_sese_1. Update call to graphite_find_data_references_in_stmt. (analyze_drs_in_stmts): Same. * tree-data-ref.c (dr_analyze_indices): Pass in parameter the loop in which the scalar analysis of indices is performed. (create_data_ref): Same. Update call to dr_analyze_indices. (find_data_references_in_stmt): Update call to create_data_ref. (graphite_find_data_references_in_stmt): Same. * tree-data-ref.h (graphite_find_data_references_in_stmt): Update declaration. (create_data_ref): Same. * tree-ssa-loop-prefetch.c (determine_loop_nest_reuse): Update call to create_data_ref. From-SVN: r169218
2011-01-25Move rewrite_commutative_reductions_out_of_ssa before find_scop_parameters.Sebastian Pop1-2/+3
2011-01-25 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (build_poly_scop): Move rewrite_commutative_reductions_out_of_ssa before find_scop_parameters. From-SVN: r169217
2011-01-25Do not create the temporary array for reductions into VAR_DECL, PARM_DECL, ↵Sebastian Pop1-1/+4
and RESULT_DECL. 2011-01-25 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (close_phi_written_to_memory): Also allow VAR_DECL, PARM_DECL, and RESULT_DECL. * gfortran.dg/graphite/interchange-3.f90: Un-XFAILed. From-SVN: r169213
2011-01-25Allow several reductions in a reduction PBB.Sebastian Pop1-1/+3
2011-01-25 Sebastian Pop <sebastian.pop@amd.com> * graphite-dependences.c (reduction_dr_1): Allow several reductions in a reduction PBB. * graphite-sese-to-poly.c (split_reduction_stmt): Do not split PBBs that have already been marked as PBB_IS_REDUCTION. From-SVN: r169212
2011-01-25Remove the temporary array for reductions written to memory.Sebastian Pop1-9/+34
2011-01-25 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (translate_scalar_reduction_to_array_for_stmt): Call unshare_expr. (close_phi_written_to_memory): New. (translate_scalar_reduction_to_array): Call close_phi_written_to_memory and unshare_expr. * gcc.dg/graphite/block-0.c: Un-XFAILed. * gcc.dg/graphite/block-1.c: Un-XFAILed. * gcc.dg/graphite/block-7.c: Un-XFAILed. * gcc.dg/graphite/block-8.c: Un-XFAILed. * gcc.dg/graphite/interchange-12.c: Un-XFAILed. * gcc.dg/graphite/interchange-14.c: Un-XFAILed. * gcc.dg/graphite/interchange-15.c: Un-XFAILed. * gcc.dg/graphite/interchange-8.c: Un-XFAILed. * gcc.dg/graphite/interchange-mvt.c: Un-XFAILed. From-SVN: r169208
2011-01-03Fix PR47021: ADDR_EXPRs don't contain SCoP parameters.Sebastian Pop1-1/+4
2011-01-03 Sebastian Pop <sebastian.pop@amd.com> PR tree-optimization/47021 * graphite-sese-to-poly.c (scan_tree_for_params): Handle ADDR_EXPR. From-SVN: r168433
2010-12-28Do not include unnecessary .h files.Sebastian Pop1-13/+0
2010-12-28 Sebastian Pop <sebastian.pop@amd.com> * Makefile.in (TREE_VECTORIZER_H): Removed duplicate definition. (tree-browser.o): Update dependences. (omega.o): Same. (tree-chrec.o): Same. (tree-scalar-evolution.o): Same. (tree-data-ref.o): Same. (sese.o): Same. (graphite.o): Same. (graphite-blocking.o): Same. (graphite-clast-to-gimple.o): Same. (graphite-cloog-util.o): Same. (graphite-dependences.o): Same. (graphite-flattening.o): Same. (graphite-interchange.o): Same. (graphite-poly.o): Same. (graphite-ppl.o): Same. (graphite-scop-detection.o): Same. (graphite-sese-to-poly.o): Same. (tree-loop-linear.o): Same. (tree-loop-distribution.o): Same. (tree-parloops.o): Same. (lambda-mat.o): Same. (lambda-trans.o): Same. (lambda-code.o): Same. * tree-browser.o: Do not include unnecessary .h files. * omega.o: Same. * tree-chrec.o: Same. * tree-scalar-evolution.o: Same. * tree-data-ref.o: Same. * sese.o: Same. * graphite.o: Same. * graphite-blocking.o: Same. * graphite-clast-to-gimple.o: Same. * graphite-cloog-util.o: Same. * graphite-dependences.o: Same. * graphite-flattening.o: Same. * graphite-interchange.o: Same. * graphite-poly.o: Same. * graphite-ppl.o: Same. * graphite-scop-detection.o: Same. * graphite-sese-to-poly.o: Same. * tree-loop-linear.o: Same. * tree-loop-distribution.o: Same. * tree-parloops.o: Same. * lambda-mat.o: Same. * lambda-trans.o: Same. * lambda-code.o: Same. * graphite.h: Removed. From-SVN: r168296
2010-12-23Fix PR46758: Do not use int_cst_value.Sebastian Pop1-11/+11
2010-12-23 Sebastian Pop <sebastian.pop@amd.com> Richard Guenther <rguenther@suse.de> PR tree-optimization/46758 * graphite-sese-to-poly.c (scan_tree_for_params_right_scev): Use tree_int_to_gmp instead of int_cst_value. (scan_tree_for_params_int): Same. (scan_tree_for_params): Same. (pdr_add_data_dimensions): Use ppl_set_inhomogeneous_tree. * gcc.dg/graphite/run-id-pr46758.c: New. Co-Authored-By: Richard Guenther <rguenther@suse.de> From-SVN: r168211
2010-12-16Fix PR46924: Do not detect reductions outside the current SESE region.Sebastian Pop1-6/+9
2010-12-16 Sebastian Pop <sebastian.pop@amd.com> PR tree-optimization/46924 * graphite-sese-to-poly.c (detect_commutative_reduction): Do not detect reductions outside the current SESE region. * sese.h (stmt_in_sese_p): New. (defined_in_sese_p): Call stmt_in_sese_p. * gcc.dg/graphite/pr46924.c: New. From-SVN: r167962
2010-12-16re PR tree-optimization/46966 (ICE: in execute_cse_reciprocals, at ↵Jakub Jelinek1-0/+1
tree-ssa-math-opts.c:474 with -floop-interchange -fno-tree-copy-prop -fno-tree-loop-im) PR tree-optimization/46966 * graphite-sese-to-poly.c (build_scop_drs): Call free_gimple_bb for for bbs that are removed from SCOP_BBS vector. * gcc.dg/graphite/pr46966.c: New test. From-SVN: r167960
2010-12-01Fix unused warnings.Sebastian Pop1-4/+1
2010-11-26 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (analyze_drs_in_stmts): Fix set but unused warning. (rewrite_cross_bb_scalar_deps_out_of_ssa): Same. From-SVN: r167351
2010-12-01Avoid the analysis of data references after the translation out of SSA.Sebastian Pop1-66/+105
2010-11-26 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (analyze_drs): Removed. (build_scop_drs): Do not call analyze_drs. (analyze_drs_in_stmts): New. (insert_stmts): New. (insert_out_of_ssa_copy): Call analyze_drs_in_stmts. (insert_out_of_ssa_copy_on_edge): Same. (rewrite_close_phi_out_of_ssa): Call insert_stmts. (rewrite_phi_out_of_ssa): Same. (rewrite_cross_bb_scalar_dependence): Same. (split_reduction_stmt): Move data references in the new basic blocks. (translate_scalar_reduction_to_array_for_stmt): Call insert_stmts. From-SVN: r167350
2010-12-01Postpone the rewrite out of SSA to the end of the translation to polyhedral ↵Sebastian Pop1-167/+180
representation. 2010-11-22 Sebastian Pop <sebastian.pop@amd.com> PR middle-end/45297 * graphite-poly.c (new_poly_bb): Returns a poly_bb_p. Do not take the reduction bool in parameter. Clear PBB_IS_REDUCTION. Set GBB_PBB. * graphite-poly.h (new_poly_bb): Update declaration. (gbb_from_bb): Moved here... (pbb_from_bb): New. * graphite-sese-to-poly.c (var_used_in_not_loop_header_phi_node): Removed. (graphite_stmt_p): Removed. (try_generate_gimple_bb): Returns a gimple_bb_p. Do not pass in sbitmap reductions. Always build a gimple_bb_p. Do not call new_poly_bb. (build_scop_bbs_1): Do not pass in sbitmap reductions. (build_scop_bbs): Same. (gbb_from_bb): ... from here. (add_conditions_to_constraints): Moved up. (analyze_drs): New. (build_scop_drs): Call analyze_drs. Remove all the PBBs that do not contain data references. (new_pbb_from_pbb): New. (insert_out_of_ssa_copy_on_edge): Call new_pbb_from_pbb after a block is split. (rewrite_close_phi_out_of_ssa): Update call to insert_out_of_ssa_copy_on_edge. (rewrite_reductions_out_of_ssa): Now static. (rewrite_cross_bb_scalar_deps_out_of_ssa): Same. (split_pbb): New. (split_reduction_stmt): Call split_pbb. (translate_scalar_reduction_to_array): Pass in the scop, do not pass in the sbitmap reductions. (rewrite_commutative_reductions_out_of_ssa_close_phi): Same. (rewrite_commutative_reductions_out_of_ssa_loop): Same. (rewrite_commutative_reductions_out_of_ssa): Same. (build_poly_scop): Call build_scop_bbs, rewrite_commutative_reductions_out_of_ssa, rewrite_reductions_out_of_ssa, and rewrite_cross_bb_scalar_deps_out_of_ssa. Move build_scop_drs before scop_to_lst. * graphite-sese-to-poly.h (rewrite_commutative_reductions_out_of_ssa): Removed declaration. (rewrite_reductions_out_of_ssa): Same. (rewrite_cross_bb_scalar_deps_out_of_ssa): Same. (build_scop_bbs): Same. * graphite.c (graphite_transform_loops): Do not initialize reductions. Do not call build_scop_bbs, rewrite_commutative_reductions_out_of_ssa, rewrite_reductions_out_of_ssa, and rewrite_cross_bb_scalar_deps_out_of_ssa. * sese.h (struct gimple_bb): Add field pbb. (GBB_PBB): New. * gcc.dg/graphite/pr45297.c: New. From-SVN: r167348
2010-12-01Do not rewrite out of SSA scalar dependences crossing the limits of the scop.Sebastian Pop1-2/+52
2010-11-22 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (handle_scalar_deps_crossing_scop_limits): New. (rewrite_cross_bb_scalar_deps): Pass in the scop. Call handle_scalar_deps_crossing_scop_limits. (rewrite_cross_bb_scalar_deps_out_of_ssa): Create an empty BB after the scop. Update call to rewrite_cross_bb_scalar_deps. From-SVN: r167347
2010-12-01common.opt (main_input_filename, [...]): New Variable entries.Joseph Myers1-1/+0
* common.opt (main_input_filename, main_input_basename, main_input_baselength): New Variable entries. From toplev.c. * final.c (output_quoted_string): Move from toplev.c. * output.h (output_quoted_string): Move from toplev.h. * opts-global.c (read_cmdline_options): Use gcc_options pointer to access main_input_filename, main_input_baselength and main_input_basename. * targhooks.c: Include intl.h and opts.h. (option_affects_pch_p, default_get_pch_validity): Move from toplev.c. * targhooks.h (option_affects_pch_p, default_get_pch_validity): Move from toplev.h. * toplev.c (main_input_filename, main_input_basename, main_input_baselength): Move to common.opt. (output_quoted_string): Move to final.c. (warn_deprecated_use): Move to tree.c. (option_affects_pch_p, default_get_pch_validity, pch_option_mismatch, default_pch_valid_p): Move to targhooks.c. * toplev.h (skip_leading_substring): Move to tree-dump.c. (warn_deprecated_use): Move to tree.h. (output_quoted_string): Move to output.h. (main_input_filename, main_input_basename, main_input_baselength): Move to common.opt. (default_get_pch_validity, default_pch_valid_p): Move to targhooks.c. * tree-dump.c (skip_leading_substring): Move from toplev.h. * tree.c (warn_deprecated_use): Move from toplev.c. * tree.h (warn_deprecated_use): Move from toplev.h. * c-typeck.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/bfin/bfin.c, config/cris/cris.c, config/crx/crx.c, config/fr30/fr30.c, config/frv/frv.c, config/h8300/h8300.c, config/ia64/ia64.c, config/iq2000/iq2000.c, config/lm32/lm32.c, config/m32c/m32c.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/mcore/mcore.c, config/mep/mep.c, config/microblaze/microblaze.c, config/mips/mips.c, config/mmix/mmix.c, config/mn10300/mn10300.c, config/moxie/moxie.c, config/pa/pa.c, config/pdp11/pdp11.c, config/picochip/picochip.c, config/s390/s390.c, config/score/score.c, config/sh/sh.c, config/sparc/sparc.c, config/spu/spu.c, config/stormy16/stormy16.c, config/v850/v850.c, config/vax/vax.c, config/xtensa/xtensa.c, gimple-low.c, graphite-sese-to-poly.c, plugin.c, tree-cfg.c, tree-inline.c, varasm.c, xcoffout.c: Don't include toplev.h. * Makefile.in (c-typeck.o, tree-inline.o, tree-cfg.o, gimple-low.o, graphite-sese-to-poly.o, targhooks.o, plugin.o, varasm.o, xcoffout.o): Update dependencies. * config/arm/t-arm (arm.o): Update dependencies. * config/spu/t-spu-elf (spu.o): Update dependencies. cp: * cp-objcp-common.c, lex.c, typeck.c: Don't include toplev.h. * Make-lang.in (cp/lex.o, cp/cp-objcp-common.o, cp/typeck2.o): Update dependencies. java: * jcf-parse.c: Don't include toplev.h. * Make-lang.in (java/jcf-parse.o): Don't depend on toplev.h. From-SVN: r167329
2010-10-11vec.h (VEC_qsort): Define.Nathan Froyd1-4/+1
gcc/ * vec.h (VEC_qsort): Define. * dbxout.c (output_used_types): Use it. * df-scan.c (df_sort_and_compress_refs): Likewise. (df_sort_and_compress_mws): Likewise. * genautomata.c (uniq_sort_alt_states): Likewise. (evaluate_equiv_classes): Likewise. (output_trans_table): Likewise. (output_state): Likewise. * gimplify.c (compare_case_labels): Likewise. * graphite-sese-to-poly.c (graphite_sort_dominated_info): Likewise. * ipa.c (build_cdtor_fns): Likewise. * lto.c (lto_wpa_write_files): Likewise. * sel-sched.c (fill_vec_av_set): Likewise. * tree-predcom.c (determine_roots_comp): Likewise. * tree-sra.c (sort_and_spliace_var_accesses): Likewise. (splice_param_accesses): Likewise. * tree-ssa-live.c (dump_enumerated_decls): Likewise. * tree-ssa-reassoc.c (undistribute_ops_list): Likewise. (reassociate_bb): Likewise. * tree-ssa-sccvn.c (sort_scc): Likewise. * tree-ssa-structalias.c (sort_fieldstack): Likewise. gcc/ada/ * gcc-interface/utils2.c (gnat_build_constructor): Use VEC_qsort. From-SVN: r165314
2010-09-30Fix Graphite memory leaks.Sebastian Pop1-1/+0
2010-09-23 Sebastian Pop <sebastian.pop@amd.com> * graphite-clast-to-gimple.c (compute_bounds_for_level): Free le and ps. * graphite-poly.c (pbb_number_of_iterations_at_time): Free le and domain. * graphite-sese-to-poly.c (add_upper_bounds_from_estimated_nit): Do not allocate ub_expr, it is passed in initialized. From-SVN: r164809
2010-09-30Factor out is_gimple_reg calls.Sebastian Pop1-12/+6
2010-08-20 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (reduction_phi_p): Remove check for is_gimple_reg. (rewrite_degenerate_phi): Same. (rewrite_reductions_out_of_ssa): Add check for is_gimple_reg. From-SVN: r164787
2010-09-30Fix PR45229: gcc.c-torture/execute/20000412-4.c ICEs with -fgraphite-identity.Sebastian Pop1-1/+2
2010-08-17 Sebastian Pop <sebastian.pop@amd.com> PR middle-end/45229 * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps): Do not handle GIMPLE_CALLs with no LHS. From-SVN: r164785
2010-08-20vec.h (FOR_EACH_VEC_ELT): Define.Nathan Froyd1-28/+28
gcc/ * vec.h (FOR_EACH_VEC_ELT): Define. * c-decl.c: Use it. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/bfin/bfin.c: Likewise. * config/mips/mips.c: Likewise. * config/rs6000/rs6000.c: Likewise. * dbxout.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * dse.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * ggc-common.c: Likewise. * gimplify.c: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * implicit-zee.c: Likewise. * ipa-prop.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * lambda-code.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-opts.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-symtab.c: Likewise. * matrix-reorg.c: Likewise. * opts.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-data-ref.c: Likewise. * tree-emutls.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * vmsdbgout.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Use FOR_EACH_VEC_ELT. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. gcc/c-family/ * c-common.c: Use FOR_EACH_VEC_ELT. * c-gimplify.c: Likewise. * c-pragma.c: Likewise. gcc/cp/ * call.c: Use FOR_EACH_VEC_ELT. * class.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * error.c: Likewise. * except.c: Likewise. * mangle.c: Likewise. * method.c: Likewise. * name-lookup.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * repo.c: Likewise. * semantics.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * trans-openmp.c: Use FOR_EACH_VEC_ELT. gcc/java/ * class.c: Use FOR_EACH_VEC_ELT. * expr.c: Likewise. * jcf-parse.c: Likewise. * resource.c: Likewise. gcc/lto/ * lto.c: Use FOR_EACH_VEC_ELT. From-SVN: r163401
2010-08-11Fix miscompile of 416.gamess.Sebastian Pop1-0/+10
2010-07-29 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Add back the case removed in the previous patch, when the only phi argument is defined in the same loop as the phi node itself. Handle it separately from the invariant case by both propagating it outside the region and replacing the phi node with an assign. From-SVN: r163169
2010-08-11Fix gamess: the only constant phi nodes with one argument are ↵Sebastian Pop1-3/+2
is_gimple_min_invariant and SSA_NAME_IS_DEFAULT_DEF. 2010-07-28 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): The only constant phi nodes with one argument are is_gimple_min_invariant and SSA_NAME_IS_DEFAULT_DEF. * gfortran.dg/graphite/id-22.f: New. From-SVN: r163168
2010-08-11Call scev_reset_htab when Graphite out-of-SSA has changed something.Sebastian Pop1-24/+51
2010-07-27 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps): Returns a bool. (rewrite_commutative_reductions_out_of_ssa_close_phi): Same. (rewrite_commutative_reductions_out_of_ssa_loop): Same. (rewrite_cross_bb_scalar_deps_out_of_ssa): Call scev_reset_htab when something has been changed. (rewrite_commutative_reductions_out_of_ssa): Same. * gcc.dg/graphite/id-26.c: New. From-SVN: r163160
2010-08-11Fix tonto: call propagate_expr_outside_region.Sebastian Pop1-43/+21
2010-07-26 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (propagate_expr_outside_region): Also handle the case when def is in the sese region. (rewrite_close_phi_out_of_ssa): Call propagate_expr_outside_region for invariant expressions. (rewrite_cross_bb_phi_deps): Removed. (rewrite_cross_bb_scalar_deps): Also handle GIMPLE_PHI nodes. (rewrite_cross_bb_scalar_deps_out_of_ssa): Do not call rewrite_cross_bb_phi_deps. From-SVN: r163159
2010-08-11Call scev_analyzable_p only on is_gimple_reg.Sebastian Pop1-1/+4
2010-07-26 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (rewrite_commutative_reductions_out_of_ssa_loop): Call scev_analyzable_p only on is_gimple_reg * gcc.dg/graphite/id-25.c: New. From-SVN: r163158
2010-08-11Propagate constant values or parametric expressions outside the scop region.Sebastian Pop1-10/+75
2010-07-22 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (propagate_expr_outside_region): New. (rewrite_close_phi_out_of_ssa): Propagate constant values or parametric expressions outside the scop region. (rewrite_cross_bb_scalar_deps): Same. * sese.c (rename_uses): Use NULL_TREE instead of NULL for trees. * gcc.dg/graphite/run-id-5.c: New. * gcc.dg/graphite/run-id-6.c: New. * gfortran.dg/graphite/id-21.f: New. From-SVN: r163157
2010-08-11Use SSA_NAME_DEF_STMT only on SSA_NAMEs.Sebastian Pop1-1/+2
2010-07-22 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Use SSA_NAME_DEF_STMT only on SSA_NAMEs. * gcc.dg/graphite/id-24.c: New. From-SVN: r163156
2010-08-11Do not translate out-of-SSA close phi nodes that can be analyzed with scev.Sebastian Pop1-7/+17
2010-07-20 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Add an extra parameter for the region. Call scev_analyzable_p. (rewrite_reductions_out_of_ssa): Update call to rewrite_close_phi_out_of_ssa. (rewrite_cross_bb_phi_deps): Same. (rewrite_commutative_reductions_out_of_ssa_loop): Add an extra parameter for the region. Call scev_analyzable_p. (rewrite_commutative_reductions_out_of_ssa): Update call to rewrite_commutative_reductions_out_of_ssa_loop. From-SVN: r163151
2010-08-11Do not rewrite out of SSA scalar phi nodes that can be scev_analyzable_p.Sebastian Pop1-16/+4
2010-07-15 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (reduction_phi_p): Do not rewrite out of SSA scalar phi nodes that can be scev_analyzable_p. * gfortran.dg/graphite/id-20.f: Adjust testcase. From-SVN: r163148
2010-08-11Correctly handle SSA_NAME_IS_DEFAULT_DEF in rewrite_close_phi_out_of_ssa.Sebastian Pop1-2/+2
2010-07-15 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Correctly handle SSA_NAME_IS_DEFAULT_DEF. From-SVN: r163147
2010-08-11Special case non close-phi nodes with one argument in ↵Sebastian Pop1-8/+20
rewrite_close_phi_out_of_ssa. 2010-07-15 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Special case non close-phi nodes with one argument. From-SVN: r163145
2010-08-11Remove uses of loop->single_iv.Sebastian Pop1-51/+11
2010-07-15 Sebastian Pop <sebastian.pop@amd.com> * cfgloop.c (alloc_loop): Remove initialization of loop->single_iv. * cfgloop.h (struct loop): Remove single_iv field. * graphite-sese-to-poly.c (graphite_loop_normal_form): Removed. (scop_canonicalize_loops): Removed. (scop_ivs_can_be_represented): Do not use loop->single_iv. Iterate over all the loop phi nodes in loop->header. (build_poly_scop): Remove use of scop_canonicalize_loops. From-SVN: r163142
2010-08-11Also handle GIMPLE_CALLs in rewrite_cross_bb_scalar_deps.Sebastian Pop1-3/+13
2010-07-15 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps): Also handle GIMPLE_CALL. From-SVN: r163141
2010-08-11Remove expand_scalar_variables_ hack.Sebastian Pop1-14/+0
2010-07-15 Sebastian Pop <sebastian.pop@amd.com> * graphite-clast-to-gimple.c (debug_clast_name_index): Removed. (debug_clast_name_indexes_1): Removed. (debug_clast_name_indexes): Removed. (pbb_to_depth_to_oldiv): Removed. (build_iv_mapping): Replace the use of rename_map with iv_map. (translate_clast_user): Remove uses of rename_map. Allocate and free iv_map. (translate_clast_for_loop): Remove uses of rename_map. (translate_clast_for): Same. (translate_clast_guard): Same. (translate_clast): Same. (gloog): Same. * graphite-clast-to-gimple.h (debug_clast_name_indexes): Removed. * graphite-sese-to-poly.c (scev_analyzable_p): Moved... * sese.c (set_rename): Now static. (rename_variables_in_stmt): Removed. (rename_uses): New. (is_parameter): Removed. (is_iv): Removed. (expand_scalar_variables_call): Removed. (expand_scalar_variables_ssa_name): Removed. (expand_scalar_variables_expr): Removed. (expand_scalar_variables_stmt): Removed. (expand_scalar_variables): Removed. (rename_variables): Removed. (remove_condition): Removed. (get_true_edge_from_guard_bb): Removed. (get_false_edge_from_guard_bb): Removed. (struct igp): Removed. (default_before_guard): Removed. (convert_for_phi_arg): Removed. (add_guard_exit_phis): Removed. (insert_guard_phis): Removed. (graphite_copy_stmts_from_block): Now also uses iv_map and a region. Do not copy conditions. Do not copy induction variables. Call rename_uses. (copy_bb_and_scalar_dependences): Allocate a local rename_map for the translated statement. Use the iv_map for the induction variable renaming. * sese.h (copy_bb_and_scalar_dependences): Update declaration. (set_rename): Removed declaration. (scev_analyzable_p): ...here. * tree-chrec.c (chrec_apply_map): New. * tree-chrec.h (chrec_apply_map): Declared. From-SVN: r163139
2010-08-11Partially removing cloog.h and graphite-clast-to-gimple.h where possible. ↵Andreas Simbuerger1-14/+0
Removing unused function check_poly_representation. 2010-07-05 Andreas Simbuerger <simbuerg@fim.uni-passau.de> * graphite-cloog-util.h: Added cloog.h. * graphite-blocking.c: Removed cloog.h. * graphite-dependences.c: Same. * graphite-interchange.c: Same. * graphite-poly.c: Same. * graphite-ppl.c: Same. * graphite-scop-detection.c: Same. * graphite-sese-to-poly.c: Removed cloog.h. Removed graphite-clast-to-gimple.h. (check_poly_representation): Removed (unused). * graphite-sese-to-poly.h (check_poly_representation): Removed (unused). From-SVN: r163135
2010-08-11Fix 416.gamess miscompile: special case the rewrite of degenerate phi nodes.Sebastian Pop1-1/+39
2010-06-24 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (rewrite_degenerate_phi): New. (rewrite_reductions_out_of_ssa): Call it for degenerate_phi_result. From-SVN: r163131
2010-08-11Fix 435.gromacs miscompile: call rewrite_close_phi_out_of_ssa from ↵Sebastian Pop1-2/+6
rewrite_cross_bb_phi_deps. 2010-06-24 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (rewrite_cross_bb_phi_deps): Call rewrite_close_phi_out_of_ssa. * gcc.dg/graphite/id-22.c: New. From-SVN: r163130
2010-08-11Remove dead code.Sebastian Pop1-3/+0
2010-06-24 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (rewrite_cross_bb_phi_deps): Remove dead code. From-SVN: r163129
2010-08-11Run rewrite_cross_bb_phi_deps before rewrite_cross_bb_scalar_deps.Sebastian Pop1-33/+63
2010-06-23 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa): Moved up. (rewrite_cross_bb_phi_deps): Split out of rewrite_cross_bb_scalar_deps. (rewrite_cross_bb_scalar_deps_out_of_ssa): Run rewrite_cross_bb_phi_deps before rewrite_cross_bb_scalar_deps. From-SVN: r163126
2010-08-11Early return in rewrite_commutative_reductions_out_of_ssa when ↵Sebastian Pop1-0/+3
flag_associative_math is not set. 2010-06-23 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (rewrite_commutative_reductions_out_of_ssa): Early return in when flag_associative_math is not set. From-SVN: r163125
2010-08-11Always insert out of SSA copies on edges except for loop->latch.Sebastian Pop1-49/+5
2010-06-23 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Always insert out of SSA copies on edges except for loop->latch. From-SVN: r163123
2010-08-11Split rewrite_cross_bb_scalar_deps_out_of_ssa out from ↵Sebastian Pop1-0/+11
rewrite_reductions_out_of_ssa. 2010-06-23 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps_out_of_ssa): Split out of rewrite_reductions_out_of_ssa. * graphite-sese-to-poly.h (rewrite_cross_bb_scalar_deps_out_of_ssa): Declared. * graphite.c (graphite_transform_loops): Call it. From-SVN: r163122
2010-08-11Also rewrite out of SSA scalar dependences going outside the SCoP region.Sebastian Pop1-4/+9
2010-06-12 Sebastian Pop <sebastian.pop@amd.com> * graphite-clast-to-gimple.c (gloog): Remove call to sese_adjust_liveout_phis. * graphite-sese-to-poly.c (scev_analyzable_p): When scev returns an SSA_NAME, allow it to be handled by rewrite_cross_bb_scalar_deps. (rewrite_cross_bb_scalar_deps): Handle GIMPLE_PHI nodes: call rewrite_phi_out_of_ssa. * sese.c (get_vdef_before_sese): Removed. (sese_adjust_vphi): Removed. (sese_adjust_liveout_phis): Removed. * sese.h (sese_adjust_liveout_phis): Removed. From-SVN: r163118
2010-08-11Remove insert_copyout and insert_copyin.Sebastian Pop1-38/+15
2010-06-12 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (insert_out_of_ssa_copy): Pass an extra argument for the place after which to insert the out of SSA copy. (rewrite_close_phi_out_of_ssa): Update calls to insert_out_of_ssa_copy. (rewrite_phi_out_of_ssa): Same. (rewrite_cross_bb_scalar_deps): Same. (insert_copyout): Removed. (insert_copyin): Removed. (translate_scalar_reduction_to_array): Call insert_out_of_ssa_copy and insert_out_of_ssa_copy_on_edge instead of insert_copyout and insert_copyin. From-SVN: r163117
2010-08-11Detect commutative reductions in all the scops before rewriting out of SSA ↵Sebastian Pop1-11/+5
all the other scalar dependences. 2010-06-12 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (build_scop_bbs): Not static anymore. (rewrite_reductions_out_of_ssa): Same. (rewrite_commutative_reductions_out_of_ssa): Same. (build_poly_scop): Do not call these functions. * graphite-sese-to-poly.h (build_poly_scop): Declared. (rewrite_reductions_out_of_ssa): Declared. (rewrite_commutative_reductions_out_of_ssa): Declared. * graphite.c (graphite_transform_loops): Call on every scop rewrite_commutative_reductions_out_of_ssa before calling rewrite_reductions_out_of_ssa and build_scop_bbs. From-SVN: r163116
2010-08-11Fix invariant phi node removal.Sebastian Pop1-9/+11
2010-05-07 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (loop_entry_phi_arg): Renamed phi_arg_in_outermost_loop. (remove_simple_copy_phi): Call phi_arg_in_outermost_loop. (remove_invariant_phi): Same. From-SVN: r163105
2010-06-30re PR bootstrap/44726 (Yet another broken bootstrap)Sebastian Pop1-7/+8
2010-06-30 Sebastian Pop <sebastian.pop@amd.com> PR bootstrrap/44726 * graphite-sese-to-poly.c (build_poly_dr): Avoid uninitialized use. (build_alias_set_optimal_p): Likewise. (build_base_obj_set_for_drs): Likewise. From-SVN: r161631
2010-06-09Do not gather loop exit conditions on the basic blocks outside the loop.Sebastian Pop1-6/+13
2010-06-09 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (single_pred_cond): Renamed single_pred_cond_non_loop_exit. Return NULL for loop exit edges. (build_sese_conditions_before): Renamed call to single_pred_cond. (build_sese_conditions_after): Same. From-SVN: r160509
2010-06-09Fix comments and indentation.Sebastian Pop1-9/+12
2010-06-09 Sebastian Pop <sebastian.pop@amd.com> * graphite-poly.h: Fix comments and indentation. * graphite-sese-to-poly.c: Same. (build_sese_conditions_before): Compute stmt and gbb only when needed. * tree-chrec.c: Fix comments and indentation. (tree-ssa-loop-niter.c): Same. From-SVN: r160508