Commit Graph

264 Commits

Author SHA1 Message Date
Richard Biener 47ffadd915 re PR tree-optimization/82603 (ICE in ifcvt_local_dce w/ -O2 -ftree-loop-vectorize)
2017-10-20  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82603
	* tree-if-conv.c (predicate_mem_writes): Make sure to only
	remove false predicated stores.

	* gcc.dg/torture/pr82603.c: New testcase.

From-SVN: r253932
2017-10-20 11:19:03 +00:00
Richard Biener 87c7cf4766 Backport PRs 82244, 82264, 82276, 82285, 82291
2017-09-26  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2017-09-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82244
	* tree-vrp.c (remove_range_assertions): Do not propagate
	a constant to abnormals but replace the assert with a copy.

	* gcc.dg/torture/pr82244.c: New testcase.

	2017-09-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82276
	PR tree-optimization/82244
	* tree-vrp.c (build_assert_expr_for): Set
	SSA_NAME_OCCURS_IN_ABNORMAL_PHI if the variable we assert on
	has it set.
	(remove_range_assertions): Revert earlier change.

	* gcc.dg/torture/pr82276.c: New testcase.

	2017-09-20  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82264
	* tree-ssa-sccvn.c (vn_phi_eq): Use safe_dyn_cast to check
	for GIMPLE_CONDs.
	(vn_phi_lookup): Likewise.
	(vn_phi_insert): Likewise.
	* is-a.h (safe_dyn_cast): New.

	* gcc.dg/torture/pr82264.c: New testcase.

	2017-09-25  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82285
	* tree-vect-patterns.c (vect_recog_bool_pattern): Also handle
	enumeral types.

	* gcc.dg/torture/pr82285.c: New testcase.

	2017-09-22  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82291
	* tree-if-conv.c (predicate_mem_writes): Make sure to
	remove writes in blocks predicated with false.

	* gcc.dg/torture/pr82291.c: New testcase.

From-SVN: r253190
2017-09-26 10:16:40 +00:00
Jan Hubicka 5d3ebb71cb re PR tree-optimization/79347 (vect_do_peeling is messing up profile)
PR tree-ssa/79347
	* cfgloopmanip.c (lv_adjust_loop_entry_edge, loop_version): Add
	ELSE_PROB.
	* cfgloopmanip.h (loop_version): Update prototype.
	* modulo-sched.c (sms_schedule): Update call of loop_version.
	* tree-if-conv.c(version_loop_for_if_conversion): Likewise.
	* tree-parloops.c (gen_parallel_loop): Likewise.
	* tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Likewise.
	* tree-ssa-loop-split.c (split_loop): Likewise.
	* tree-ssa-loop-unswitch.c (tree_unswitch_loop): Likewise.
	* tree-vect-loop-manip.c (vect_loop_versioning): Likewise.

	* gcc.dg/tree-ssa/ifc-10.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-11.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-12.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-20040816-1.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-20040816-2.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-5.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-8.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-9.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-cd.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-pr56541.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-pr68583.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-pr69489-1.c: Match for profile mismatches.
	* gcc.dg/tree-ssa/ifc-pr69489-2.c: Match for profile mismatches.

From-SVN: r245196
2017-02-05 17:16:52 +00:00
Jakub Jelinek cb330ba582 re PR tree-optimization/78899 (Vestorized loop with optmized mask stores motion is completely deleted after r242520.)
PR tree-optimization/78899
	* tree-if-conv.c (version_loop_for_if_conversion): Instead of
	returning bool return struct loop *, NULL for failure and the new
	loop on success.
	(versionable_outer_loop_p): Don't version outer loop if it has
	dont_vectorized bit set.
	(tree_if_conversion): When versioning outer loop, ensure
	tree_if_conversion is performed also on the inner loop of the
	non-vectorizable outer loop copy.
	* tree-vectorizer.c (set_uid_loop_bbs): Formatting fix.  Fold
	LOOP_VECTORIZED in inner loop of the scalar outer loop and
	prevent vectorization of it.
	(vectorize_loops): For outer + inner LOOP_VECTORIZED, ensure
	the outer loop vectorization of the non-scalar version is attempted
	before vectorization of the inner loop in scalar version.  If
	outer LOOP_VECTORIZED guarded loop is not vectorized, prevent
	vectorization of its inner loop.
	* tree-vect-loop-manip.c (rename_variables_in_bb): If outer_loop
	has 2 inner loops, rename also on edges from bb whose single pred
	is outer_loop->header.  Fix typo in function comment.

	* gcc.target/i386/pr78899.c: New test.
	* gcc.dg/pr71077.c: New test.

From-SVN: r244238
2017-01-09 21:10:23 +01:00
Jakub Jelinek cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00
Bin Cheng b54819879e fold-const.c (fold_cond_expr_with_comparison): Move simplification for A cmp C1 ? A : C2 to below, also simplify remaining code.
* fold-const.c (fold_cond_expr_with_comparison): Move simplification
	for A cmp C1 ? A : C2 to below, also simplify remaining code.
	* match.pd: Move and extend simplification from above to here:
	(cond (cmp (convert1? x) c1) (convert2? x) c2) -> (minmax (x c)).
	* tree-if-conv.c (ifcvt_follow_ssa_use_edges): New func.
	(predicate_scalar_phi): Call fold_stmt using the new valueize func.

	gcc/testsuite
	* gcc.dg/fold-cond_expr-1.c: New test.
	* gcc.dg/fold-condcmpconv-1.c: New test.
	* gcc.dg/fold-condcmpconv-2.c: New test.

From-SVN: r242750
2016-11-23 12:44:08 +00:00
Jakub Jelinek 9b28cb6f0a re PR middle-end/78445 (ICE in maybe_gen_insn, at optabs.c:7014)
PR tree-optimization/78445
	* tree-if-conv.c (tree_if_conversion): If any_pred_load_store or
	any_complicated_phi, version loop even if flag_tree_loop_if_convert is
	1.  Formatting fix.

	* gcc.dg/pr78445.c: New test.

From-SVN: r242689
2016-11-22 11:13:01 +01:00
Bill Schmidt eeeaf7199a re PR tree-optimization/78413 (ICE in single_pred_edge, at basic-block.h:361)
[gcc]

2016-11-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/78413
	* tree-if-conv.c (versionable_outer_loop_p): Require that both
	inner and outer loop latches have single predecessors.

[gcc/testsuite]

2016-11-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/78413
	* gcc.dg/tree-ssa/pr78413.c: New test.

From-SVN: r242661
2016-11-21 14:10:11 +00:00
Bill Schmidt 54e63f0028 re PR tree-optimization/77848 (Gimple if-conversion results in redundant comparisons)
[gcc]

2016-11-17  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
            Richard Biener  <rguenther@suse.de>

	PR tree-optimization/77848
	* tree-if-conv.c (tree_if_conversion): Always version loops unless
	the user specified -ftree-loop-if-convert.

[gcc/testsuite]

2016-11-17  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
            Richard Biener  <rguenther@suse.de>

	PR tree-optimization/77848
	* gfortran.dg/vect/pr77848.f: New test.


Co-Authored-By: Richard Biener <rguenther@suse.de>

From-SVN: r242550
2016-11-17 14:22:17 +00:00
Richard Biener bef69eb57d common.opt (ftree-loop-if-convert-stores): Mark as preserved for backward compatibility.
2016-11-17  Richard Biener  <rguenther@suse.de>

	* common.opt (ftree-loop-if-convert-stores): Mark as preserved for
	backward compatibility.
	* doc/invoke.texi (ftree-loop-if-convert-stores): Remove.
	* tree-if-conv.c (pass_if_conversion::gate): Do not test
	flag_tree_loop_if_convert_stores.
	(pass_if_conversion::execute): Likewise.

From-SVN: r242542
2016-11-17 12:38:47 +00:00
William Schmidt 23bed4148e Commentary corrections
From-SVN: r242521
2016-11-16 22:31:24 +00:00
Bill Schmidt 9e16e65681 re PR tree-optimization/77848 (Gimple if-conversion results in redundant comparisons)
2016-11-16  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/77848
	* tree-if-conv.c (version_loop_for_if_conversion): When versioning
	an outer loop, only save basic block aux information for the inner
	loop.
	(versionable_outer_loop_p): New function.
	(tree_if_conversion): Version the outer loop instead of the inner
	one if the pattern will be recognized for outer-loop
	vectorization.

From-SVN: r242520
2016-11-16 22:17:10 +00:00
Yuri Rumyantsev 598eaaa2a2 Support non-masked epilogue vectoriziation
gcc/

2016-11-16  Yuri Rumyantsev  <ysrumyan@gmail.com>

	* params.def (PARAM_VECT_EPILOGUES_NOMASK): New.
	* tree-if-conv.c (tree_if_conversion): Make public.
	* * tree-if-conv.h: New file.
	* tree-vect-data-refs.c (vect_analyze_data_ref_dependences) Avoid
	dynamic alias checks for epilogues.
	* tree-vect-loop-manip.c (vect_do_peeling): Return created epilog.
	* tree-vect-loop.c: include tree-if-conv.h.
	(new_loop_vec_info): Add zeroing orig_loop_info field.
	(vect_analyze_loop_2): Don't try to enhance alignment for epilogues.
	(vect_analyze_loop): Add argument ORIG_LOOP_INFO which is not NULL
	if epilogue is vectorized, set up orig_loop_info field of loop_vinfo
	using passed argument.
	(vect_transform_loop): Check if created epilogue should be returned
	for further vectorization with less vf.  If-convert epilogue if
	required. Print vectorization success for epilogue.
	* tree-vectorizer.c (vectorize_loops): Add epilogue vectorization
	if it is required, pass loop_vinfo produced during vectorization of
	loop body to vect_analyze_loop.
	* tree-vectorizer.h (struct _loop_vec_info): Add new field
	orig_loop_info.
	(LOOP_VINFO_ORIG_LOOP_INFO): New.
	(LOOP_VINFO_EPILOGUE_P): New.
	(LOOP_VINFO_ORIG_VECT_FACTOR): New.
	(vect_do_peeling): Change prototype to return epilogue.
	(vect_analyze_loop): Add argument of loop_vec_info type.
	(vect_transform_loop): Return created loop.

gcc/testsuite/

2016-11-16  Yuri Rumyantsev  <ysrumyan@gmail.com>

	* lib/target-supports.exp (check_avx2_hw_available): New.
	(check_effective_target_avx2_runtime): New.
	* gcc.dg/vect/vect-tail-nomask-1.c: New test.

From-SVN: r242501
2016-11-16 08:22:39 -08:00
Yuri Rumyantsev 1d30acf687 Update dom_info
2016-10-17  Yuri Rumyantsev  <ysrumyan@gmail.com>

	* dominance.c (dom_info::dom_info): Add new constructor for region
	which is vector of basic blocks.
	(dom_init): New method to initialize members common for both
	constructors.
	(dom_info::dom_info): Invoke dom_init for partial initialization.
	(dom_info::get_idom): Add check to corner cases on basic blocks which
	are not in region.
	(dom_info::calc_dfs_tree): Check M_FAKE_EXIT_EDGE instead of M_REVERSE
	to detect unreachable bbs.
	(dom_info::calc_idoms): Likewise.
	(compute_dom_fast_query_in_region): New function.
	(calculate_dominance_info_for_region): Likewise.
	(free_dominance_info_for_region): Likewise.
	* dominance.h: Add prototypes for introduced region-based functions
	tree-if-conv.c: (build_region): New function.
	(if_convertible_loop_p_1): Invoke local version of post-dominators
	calculation before basic block predication with subsequent freeing
	post-dominator info.
	(tree_if_conversion): Remove free of post-dominator info
	(pass_if_conversion::execute): Delete detection of infinite loops
	and fake edges to exit block since post-dominator calculation is
	performed per if-converted loop only.

From-SVN: r241275
2016-10-17 11:05:12 -07:00
Jakub Jelinek bbfac6da60 auto-inc-dec.c (try_merge): Remove break after return.
* auto-inc-dec.c (try_merge): Remove break after return.
	* cselib.c (autoinc_split): Likewise.
	* explow.c (promote_mode): Likewise.
	* fixed-value.c (fixed_arithmetic): Likewise.
	* hsa.c (hsa_internal_fn::get_arity): Likewise.
	* rtlanal.c (modified_between_p, modified_in_p): Likewise.
	* trans-mem.c (get_attrs_for): Likewise.
	* tree-if-conv.c (if_convertible_stmt_p): Likewise.
	* tree-vrp.c (simplify_stmt_using_ranges): Likewise.
	* config/aarch64/aarch64-builtins.c (aarch64_fold_builtin): Likewise.
	* config/aarch64/aarch64.c (aarch64_get_condition_code_1): Likewise.
	* config/c6x/c6x.c (c6x_get_unit_specifier): Likewise.
	* config/cr16/cr16.c (legitimate_pic_operand_p): Likewise.
	* config/cris/cris.c (cris_op_str): Likewise.
	* config/mn10300/mn10300.c (cc_flags_for_code): Likewise.
	* config/tilepro/tilepro.c (tilepro_emit_setcc_internal_di): Likewise.
c-family/
	* c-ada-spec.c (print_ada_declaration): Remove break after return.
objc/
	* objc-act.c (continue_class): Remove break after return.
	(objc_maybe_printable_name): Likewise.
fortran/
	* dependency.c (gfc_dep_compare_expr): Remove break after return.
	* frontend-passes.c (optimize_op): Likewise.
	* interface.c (gfc_current_interface_head): Likewise.
	* symbol.c (check_conflict): Likewise.
	* trans-intrinsic.c (build_fix_expr): Likewise.
ada/
	* terminals.c (is_gui_app): Remove break after return.

From-SVN: r240554
2016-09-27 20:14:10 +02:00
Richard Biener eeead3a6f1 ssa-iterators.h (ssa_vuse_operand): New inline.
2016-08-18  Richard Biener  <rguenther@suse.de>

	* ssa-iterators.h (ssa_vuse_operand): New inline.
	* tree-if-conv.c (ifc_temp_var): Update virtual operand.
	(predicate_all_scalar_phis): Use remove_phi_node to remove
	phi nodes predicated.  Delay removing virtual PHIs.
	(predicate_mem_writes): Update virtual operands.
	(combine_blocks): Likewise.  Propagate out remaining virtual PHIs.
	(tree_if_conversion): Do not rewrite virtual SSA form.
	* tree-phinodes.c (release_phi_node): Make static.
	* tree-phinodes.h (release_phi_node): Remove.

From-SVN: r239560
2016-08-18 07:21:11 +00:00
Bin Cheng 04ac4afa84 re PR tree-optimization/71503 (gcc ICE at -O3 on valid code on x86_64-linux-gnu in "gen_phi_arg_condition")
PR tree-optimization/71503
	PR tree-optimization/71683
	* tree-if-conv.c (gen_phi_arg_condition): Record true predicate
	and break.

	gcc/testsuite
	PR tree-optimization/71503
	PR tree-optimization/71683
	* gcc.dg/tree-ssa/ifc-pr71503.c: New test.
	* gcc.dg/tree-ssa/ifc-pr71683.c: New test.

From-SVN: r238512
2016-07-20 08:31:35 +00:00
Richard Biener fa2c903458 re PR tree-optimization/71261 (Trunk GCC hangs on knl and broadwell targets)
2016-06-01  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71261
	* tree-vect-patterns.c (check_bool_pattern): Gather a hash-set
	of stmts successfully put in the bool pattern.  Remove
	single-use restriction.
	(adjust_bool_pattern_cast): Add cast at the use site via the
	pattern def sequence.
	(adjust_bool_pattern): Remove recursion, maintain a hash-map
	of patterned defs.  Use the pattern def seqence instead of
	multiple independent patterns.
	(sort_after_uid): New qsort compare function.
	(adjust_bool_stmts): New function to process stmts in the bool
	pattern in IL order.
	(vect_recog_bool_pattern): Adjust.
	* tree-if-conv.c (ifcvt_split_def_stmt): Remove.
	(ifcvt_walk_pattern_tree): Likewise.
	(stmt_is_root_of_bool_pattern): Likewise.
	(ifcvt_repair_bool_pattern): Likewise.
	(tree_if_conversion): Do not call ifcvt_repair_bool_pattern.

	* gcc.dg/torture/vect-bool-1.c: New testcase.

From-SVN: r236989
2016-06-01 13:08:24 +00:00
Richard Biener 3072d4ea29 re PR tree-optimization/71261 (Trunk GCC hangs on knl and broadwell targets)
2016-05-25  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71261
	* tree-if-conv.c (ifcvt_split_def_stmt): Walk uses on the
	interesting stmt instead of immediate uses when looking
	for the use operand to replace.

	* c-c++-common/torture/pr71261.c: New testcase.

From-SVN: r236701
2016-05-25 11:49:03 +00:00
Richard Biener 6ca8e33c66 timevar.def (TV_TREE_LOOP_IFCVT): Add.
2016-05-25  Richard Biener  <rguenther@suse.de>

	* timevar.def (TV_TREE_LOOP_IFCVT): Add.
	* tree-if-conv.c (pass_data_if_conversion): Use it.

From-SVN: r236695
2016-05-25 08:52:22 +00:00
Richard Biener 58f10249a8 tree-if-conv.c (add_bb_predicate_gimplified_stmts): Use gimple_seq_add_seq_without_update.
2016-05-20  Richard Biener  <rguenther@suse.de>

	* tree-if-conv.c (add_bb_predicate_gimplified_stmts): Use
	gimple_seq_add_seq_without_update.
	(release_bb_predicate): Assert we have no operands to free.
	(if_convertible_loop_p_1): Calculate post dominators later.
	Do not free BB predicates here.
	(combine_blocks): Do not recompute BB predicates.
	(version_loop_for_if_conversion): Save BB predicates around
	loop versioning.

	* gcc.dg/tree-ssa/ifc-cd.c: Adjust.

From-SVN: r236498
2016-05-20 09:01:23 +00:00
Martin Liska f6b8cbb70e Fix memory leak in tree-if-conv.c
* tree-if-conv.c (ifcvt_repair_bool_pattern): Utilize auto_vecs.

From-SVN: r236470
2016-05-19 15:06:47 +00:00
Bin Cheng 18caa34eb2 tree-if-conv.c (tree-ssa-loop.h): Include header file.
* tree-if-conv.c (tree-ssa-loop.h): Include header file.
	(tree-ssa-loop-niter.h): Ditto.
	(idx_within_array_bound, ref_within_array_bound): New functions.
	(ifcvt_memrefs_wont_trap): Check if array ref is within bound.
	Factor out check on writable base object to ...
	(base_object_writable): ... here.

	gcc/testsuite/
	* gcc.dg/tree-ssa/ifc-9.c: New test.
	* gcc.dg/tree-ssa/ifc-10.c: New test.
	* gcc.dg/tree-ssa/ifc-11.c: New test.
	* gcc.dg/tree-ssa/ifc-12.c: New test.
	* gcc.dg/vect/pr61194.c: Remove XFAIL.
	* gcc.dg/vect/vect-23.c: Remove XFAIL.
	* gcc.dg/vect/vect-mask-store-move-1.c: Revise test check.

From-SVN: r236026
2016-05-09 11:44:03 +00:00
Martin Liska 734c152691 Fix memory leak in tree-if-conv.c
* tree-if-conv.c (ifcvt_split_critical_edges): Use auto_vec
	instead of vec as the vector is local to the function.

From-SVN: r235974
2016-05-06 14:26:23 +00:00
Richard Biener 078f7e37ba re PR tree-optimization/70960 (ICE: tree check: expected ssa_name, have integer_cst in ifcvt_walk_pattern_tree, at tree-if-conv.c:2465)
2016-05-06  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/70960
	* tree-if-conv.c (ifcvt_walk_pattern_tree): Handle non-SSA ops.

	* gfortran.fortran-torture/compile/pr70960.f90: New testcase.

From-SVN: r235953
2016-05-06 10:18:59 +00:00
Jakub Jelinek 9663f8f748 re PR tree-optimization/70916 (gcc ICE at -O3 on valid code on x86_64-linux-gnu in "tree_operand_check")
PR tree-optimization/70916
	* tree-if-conv.c: Include cfganal.h.
	(pass_if_conversion::execute): Call connect_infinite_loops_to_exit
	and remove_fake_exit_edges around the optimization pass.

Co-Authored-By: Richard Biener <rguenther@suse.de>

From-SVN: r235842
2016-05-03 21:30:22 +02:00
Jakub Jelinek e7437b594f re PR tree-optimization/70916 (gcc ICE at -O3 on valid code on x86_64-linux-gnu in "tree_operand_check")
PR tree-optimization/70916
	* tree-if-conv.c (constant_or_ssa_name): Removed.
	(fold_build_cond_expr): Use is_gimple_val instead of
	constant_or_ssa_name.

From-SVN: r235815
2016-05-03 13:43:06 +02:00
Bin Cheng 1cfcd39eee re PR tree-optimization/56541 (vectorizaton fails in conditional assignment of a constant)
PR tree-optimization/56541
	* doc/invoke.texi (@item max-tree-if-conversion-phi-args): New item.
	* params.def (PARAM_MAX_TREE_IF_CONVERSION_PHI_ARGS): new param.
	* tree-if-conv.c (MAX_PHI_ARG_NUM): new macro.
	(any_complicated_phi): new static variable.
	(aggressive_if_conv): delete.
	(if_convertible_phi_p): support phis with more than two arguments.
	(if_convertible_bb_p): remvoe check on aggressive_if_conv and
	critical pred edges.
	(ifcvt_split_critical_edges): support phis with more than two
	arguments by checking new parameter.  only split critical edges
	if needed.
	(tree_if_conversion): handle simd pragma marked loop using new
	local variable aggressive_if_conv.  check any_complicated_phi.

	gcc/testsuite
	PR tree-optimization/56541
	* gcc.dg/tree-ssa/ifc-pr56541.c: new test.
	* gcc.dg/vect/pr56541.c: new test.

From-SVN: r235808
2016-05-03 09:04:46 +00:00
Bin Cheng 520435ec6e tree-if-conv.c (any_pred_load_store): New static variable.
* tree-if-conv.c (any_pred_load_store): New static variable.
	(if_convertible_gimple_assign_stmt_p): Remove parameter.  Use
	any_pred_load_store instead of and_mask_load_store.
	(if_convertible_stmt_p, if_convertible_loop_p_1): Ditto.
	(if_convertible_loop_p, insert_gimplified_predicates): Ditto.
	(combine_blocks, tree_if_conversion): Ditto.

From-SVN: r235437
2016-04-26 11:16:07 +00:00
Bin Cheng 00f615afef re PR tree-optimization/70771 (ICE on valid code at -O3 on x86_64-linux-gnu in operator[], at vec.h:714)
PR tree-optimization/70771
	PR tree-optimization/70775
	* tree-if-conv.c (if_convertible_phi_p): Remove check on special
	virtual PHI nodes.  Delete parameter.
	(if_convertible_loop_p_1): Delete argument to above function.
	(predicate_all_scalar_phis): Delete code handling single-argument
	PHIs.
	(tree_if_conversion): Mark and update virtual SSA.

	gcc/testsuite/ChangeLog
	PR tree-optimization/70771
	PR tree-optimization/70775
	* gcc.dg/pr70771.c: New test.
	* gcc.dg/pr70771.c: New test.

From-SVN: r235436
2016-04-26 11:10:47 +00:00
Richard Biener 49f428c9f4 re PR tree-optimization/70725 (Internal compiler error (ICE) on valid code)
2016-04-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/70725
	* tree-if-conv.c (if_convertible_phi_p): Adjust guard
	for phi_convertible_by_degenerating_args.
	(predicate_all_scalar_phis): Handle single-argument PHIs.

From-SVN: r235341
2016-04-21 14:09:33 +00:00
Bin Cheng 1011119f47 re PR tree-optimization/69489 (missed vectorization for boolean loop, missed if-conversion)
PR tree-optimization/69489
	* tree-if-conv.c (phi_convertible_by_degenerating_args): New.
	(if_convertible_phi_p): Call phi_convertible_by_degenerating_args.
	Revise dump message.
	(if_convertible_bb_p): Remove check on edge count of basic block's
	predecessors.

	gcc/testsuite/ChangeLog
	PR tree-optimization/69489
	* gcc.dg/tree-ssa/ifc-pr69489-2.c: New test.

From-SVN: r235292
2016-04-20 15:57:01 +00:00
Bin Cheng fad08d127f re PR tree-optimization/56625 (After if-conversion vectorizer doesn't recognize similar loads)
PR tree-optimization/56625
	PR tree-optimization/69489
	* tree-data-ref.h (DR_INNERMOST): New macro.
	* tree-if-conv.c (innermost_loop_behavior_hash): New class for
	hashing struct innermost_loop_behavior.
	(ref_DR_map): Remove.
	(innermost_DR_map): New map.
	(baseref_DR_map): Revise comment.
	(hash_memrefs_baserefs_and_store_DRs_read_written_info): Store DR
	to innermost_DR_map accroding to its innermost loop behavior.
	(ifcvt_memrefs_wont_trap): Get DR from innermost_DR_map according
	to its innermost loop behavior.
	(if_convertible_loop_p_1): Remove intialization for ref_DR_map.
	Add initialization for innermost_DR_map.  Record memory reference
	in DR_BASE_ADDRESS if the reference is compound one or it doesn't
	have innermost loop behavior.
	(if_convertible_loop_p): Remove release for ref_DR_map.  Release
	innermost_DR_map.

	gcc/testsuite/ChangeLog
	PR tree-optimization/56625
	PR tree-optimization/69489
	* gcc.dg/vect/pr56625.c: New test.
	* gcc.dg/tree-ssa/ifc-pr69489-1.c: New test.

From-SVN: r235289
2016-04-20 15:41:45 +00:00
Marek Polacek dd39022b9e tree-if-conv.c (is_false_predicate): For NULL_TREE return false rather than true.
* tree-if-conv.c (is_false_predicate): For NULL_TREE return false
	rather than true.

From-SVN: r235272
2016-04-20 12:37:38 +00:00
Marek Polacek 2697b18902 re PR tree-optimization/70725 (Internal compiler error (ICE) on valid code)
PR tree-optimization/70725
	* tree-if-conv.c (is_false_predicate): New function.
	(predicate_mem_writes): Use it.

	* gcc.dg/pr70725.c: New test.

From-SVN: r235250
2016-04-20 09:32:45 +00:00
Jakub Jelinek 818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
Richard Biener 2c3903c73b tree-if-conv.c: Include params.h.
2015-12-10  Richard Biener  <rguenther@suse.de>

	* tree-if-conv.c: Include params.h.
	(ifcvt_memrefs_wont_trap): Use PARAM_ALLOW_STORE_DATA_RACES
	instead of flag_tree_loop_if_convert_stores to guard cases
	we'd introduce store-data-races.

From-SVN: r231495
2015-12-10 09:10:40 +00:00
Richard Biener a839a8f708 tree-if-conv.c (if_convertible_loop_p_1): Do not compute dependences.
2015-12-10  Richard Biener  <rguenther@suse.de>

	* tree-if-conv.c (if_convertible_loop_p_1): Do not compute
	dependences.
	(if_convertible_loop_p): Adjust.

From-SVN: r231492
2015-12-10 09:00:07 +00:00
Jakub Jelinek 08554c26c4 re PR tree-optimization/68786 (Aligned masked store is generated for unaligned pointer)
PR tree-optimization/68786
	* tree-if-conv.c: Include builtins.h.
	(predicate_mem_writes): Put result of get_object_alignment (ref)
	into second argument's value.
	* tree-vect-stmts.c (vectorizable_mask_load_store): Put minimum
	pointer alignment into second argument's value.
	* tree-data-ref.c (get_references_in_stmt): Use value of second
	argument for build_aligned_type, and only the type to build
	a zero second argument for MEM_REF.
	* internal-fn.c (expand_mask_load_optab_fn,
	expand_mask_store_optab_fn): Likewise.

From-SVN: r231454
2015-12-09 14:42:06 +01:00
Richard Biener e56c602ea3 re PR tree-optimization/68583 (Missed if-conversion)
2015-12-09  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/68583
	* tree-if-conv.c (if_convertible_phi_p): Drop
	flag_tree_loop_if_convert_stores check in favor of the
	existing any_mask_load_store check.
	(insert_gimplified_predicates): Likewise.
	(combine_blocks): Likewise.
	(tree_if_conversion): Likewise.
	(ifcvt_memrefs_wont_trap): Properly check
	flag_tree_loop_if_convert_stores in all places that can end
	up introducing store-data-races.
	(if_convertible_gimple_assign_stmt_p): Remove restriction
	on flag_tree_loop_if_convert_stores for stores we can if-convert
	without introducing store-data-races.  Force versioning for
	all if-converted stores.

	* gcc.dg/tree-ssa/ifc-pr68583.c: New testcase.
	* gcc.dg/vect/vect-72.c: Adjust.
	* gcc.dg/vect/vect-cselim-2.c: Likewise.
	* gcc.dg/vect/vect-strided-store-a-u8-i2.c: Likewise.

From-SVN: r231453
2015-12-09 13:30:41 +00:00
Martin Liska d2b04f0b7b Fix memory leak in tree-if-conv.c
* tree-if-conv.c (ifcvt_local_dce): Replace vec with auto_vec.

From-SVN: r231447
2015-12-09 09:38:00 +00:00
Richard Biener db9be04ed8 re PR tree-optimization/68583 (Missed if-conversion)
2015-12-09  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/68583
	* tree-if-conv.c (ifc_dr): Make flags bool, add w_unconditionally
	flag and rename predicates to w_predicate, rw_predicate and
	base_w_predicate.
	(DR_WRITTEN_AT_LEAST_ONCE): Rename to ...
	(DR_BASE_W_UNCONDITIONALLY): ... this.
	(DR_W_UNCONDITIONALLY): Add.
	(hash_memrefs_baserefs_and_store_DRs_read): Adjust.  Compute
	unconditionally written separately from read or written.
	(ifcvt_memrefs_wont_trap): Properly treat reads.
	(ifcvt_could_trap_p): Inline ...
	(if_convertible_gimple_assign_stmt_p): ... here.  Refactor
	to avoid code duplication.
	(if_convertible_loop_p_1): Adjust and properly initialize
	predicates.

From-SVN: r231444
2015-12-09 08:32:49 +00:00
Venkataramanan Kumar 6b8320bc8b tree-if-conv.c (struct ifc_dr): Add new tree base_predicate field.
2015-11-30  Venkataramanan Kumar  <Venkataramanan.Kumar@amd.com>

	* tree-if-conv.c (struct ifc_dr): Add new tree
	base_predicate field.
	(hash_memrefs_baserefs_and_store_DRs_read_written_info): Hash
	base ref, DR pairs and store base_predicate for write type DRs.
	(ifcvt_memrefs_wont_trap): Guard checks with
	-ftree-loop-if-convert-stores flag.

From-SVN: r231057
2015-11-30 07:59:54 +00:00
Venkataramanan Kumar f939586ac5 Relax trap assumptions in tree if convert.
2015-11-17  Venkataramanan Kumar  <Venkataramanan.Kumar@amd.com>

	* tree-if-conv.c: Include varasm.h
	(ref_DR_map): Define.
	(baseref_DR_map): Like wise
	(struct ifc_dr): Add new tree predicate field.
	(hash_memrefs_baserefs_and_store_DRs_read_written_info): New function.
	(memrefs_read_or_written_unconditionally): Remove.
	(write_memrefs_written_at_least_once): Remove.
	(ifcvt_memrefs_wont_trap): Use hash maps to query
	unconditional read/written information.
	(if_convertible_loop_p_1):  Initialize hash maps and predicates
	before hashing data references and delete hashmaps at the end.

2015-11-17  Venkataramanan Kumar  <Venkataramanan.Kumar@amd.com>

	* gcc.dg/tree-ssa/ifc-8.c: New test.

From-SVN: r230454
2015-11-17 07:41:08 +00:00
Ilya Enkovich 045c12782c internal-fn.c (expand_MASK_LOAD): Adjust to maskload optab changes.
gcc/

	* internal-fn.c (expand_MASK_LOAD): Adjust to maskload optab changes.
	(expand_MASK_STORE): Adjust to maskstore optab changes.
	* optabs-query.c (can_vec_mask_load_store_p): Add MASK_MODE arg.
	 Adjust to maskload, maskstore optab changes.
	* optabs-query.h (can_vec_mask_load_store_p): Add MASK_MODE arg.
	* optabs.def (maskload_optab): Transform into convert optab.
	(maskstore_optab): Likewise.
	* tree-if-conv.c (ifcvt_can_use_mask_load_store): Adjust to
	can_vec_mask_load_store_p signature change.
	(predicate_mem_writes): Use boolean mask.
	* tree-vect-stmts.c (vectorizable_mask_load_store): Adjust to
	can_vec_mask_load_store_p signature change.  Allow invariant masks.
	(vectorizable_operation): Ignore type precision for boolean vectors.

gcc/testsuite/

	* gcc.target/i386/avx2-vec-mask-bit-not.c: New test.

From-SVN: r230099
2015-11-10 12:06:05 +00:00
Andrew MacLeod 68a750e938 alias.c: Remove unused headers.
2015-10-30  Andrew MacLeod  <amacleod@redhat.com>
	
	* alias.c: Remove unused headers.
	* asan.c: Likewise.
	* attribs.c: Likewise.
	* auto-inc-dec.c: Likewise.
	* auto-profile.c: Likewise.
	* bb-reorder.c: Likewise.
	* bitmap.c: Likewise.
	* bt-load.c: Likewise.
	* builtins.c: Likewise.
	* caller-save.c: Likewise.
	* calls.c: Likewise.
	* ccmp.c: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfgexpand.c: Likewise.
	* cfghooks.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgloopanal.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.c: Likewise.
	* cgraphbuild.c: Likewise.
	* cgraphclones.c: Likewise.
	* cgraphunit.c: Likewise.
	* cilk-common.c: Likewise.
	* combine-stack-adj.c: Likewise.
	* combine.c: Likewise.
	* compare-elim.c: Likewise.
	* convert.c: Likewise.
	* coverage.c: Likewise.
	* cppbuiltin.c: Likewise.
	* cprop.c: Likewise.
	* cse.c: Likewise.
	* cselib.c: Likewise.
	* data-streamer-in.c: Likewise.
	* data-streamer-out.c: Likewise.
	* data-streamer.c: Likewise.
	* dbxout.c: Likewise.
	* dce.c: Likewise.
	* ddg.c: Likewise.
	* debug.c: Likewise.
	* df-core.c: Likewise.
	* df-problems.c: Likewise.
	* df-scan.c: Likewise.
	* dfp.c: Likewise.
	* dojump.c: Likewise.
	* dominance.c: Likewise.
	* domwalk.c: Likewise.
	* double-int.c: Likewise.
	* dse.c: Likewise.
	* dumpfile.c: Likewise.
	* dwarf2asm.c: Likewise.
	* dwarf2cfi.c: Likewise.
	* dwarf2out.c: Likewise.
	* emit-rtl.c: Likewise.
	* except.c: Likewise.
	* explow.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* final.c: Likewise.
	* fixed-value.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* fwprop.c: Likewise.
	* gcse.c: Likewise.
	* generic-match-head.c: Likewise.
	* ggc-common.c: Likewise.
	* gimple-builder.c: Likewise.
	* gimple-expr.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-iterator.c: Likewise.
	* gimple-low.c: Likewise.
	* gimple-match-head.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* gimple-ssa-isolate-paths.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimple-streamer-in.c: Likewise.
	* gimple-streamer-out.c: Likewise.
	* gimple-walk.c: Likewise.
	* gimple.c: Likewise.
	* gimplify-me.c: Likewise.
	* gimplify.c: Likewise.
	* godump.c: Likewise.
	* graph.c: Likewise.
	* graphds.c: Likewise.
	* haifa-sched.c: Likewise.
	* hw-doloop.c: Likewise.
	* ifcvt.c: Likewise.
	* init-regs.c: Likewise.
	* internal-fn.c: Likewise.
	* ipa-chkp.c: Likewise.
	* ipa-comdats.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-icf-gimple.c: Likewise.
	* ipa-icf.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* ipa-inline-transform.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-polymorphic-call.c: Likewise.
	* ipa-profile.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-ref.c: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa-visibility.c: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-conflicts.c: Likewise.
	* ira-costs.c: Likewise.
	* ira-emit.c: Likewise.
	* ira-lives.c: Likewise.
	* ira.c: Likewise.
	* jump.c: Likewise.
	* langhooks.c: Likewise.
	* lcm.c: Likewise.
	* lists.c: Likewise.
	* loop-doloop.c: Likewise.
	* loop-init.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-iv.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lra-assigns.c: Likewise.
	* lra-coalesce.c: Likewise.
	* lra-constraints.c: Likewise.
	* lra-eliminations.c: Likewise.
	* lra-lives.c: Likewise.
	* lra-remat.c: Likewise.
	* lra-spills.c: Likewise.
	* lra.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-compress.c: Likewise.
	* lto-opts.c: Likewise.
	* lto-section-in.c: Likewise.
	* lto-section-out.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* mcf.c: Likewise.
	* mode-switching.c: Likewise.
	* modulo-sched.c: Likewise.
	* optabs.c: Likewise.
	* opts-global.c: Likewise.
	* passes.c: Likewise.
	* plugin.c: Likewise.
	* postreload-gcse.c: Likewise.
	* postreload.c: Likewise.
	* predict.c: Likewise.
	* print-tree.c: Likewise.
	* profile.c: Likewise.
	* real.c: Likewise.
	* realmpfr.c: Likewise.
	* recog.c: Likewise.
	* ree.c: Likewise.
	* reg-stack.c: Likewise.
	* regcprop.c: Likewise.
	* reginfo.c: Likewise.
	* regrename.c: Likewise.
	* regstat.c: Likewise.
	* reload.c: Likewise.
	* reload1.c: Likewise.
	* reorg.c: Likewise.
	* resource.c: Likewise.
	* rtl-chkp.c: Likewise.
	* rtl-error.c: Likewise.
	* rtlanal.c: Likewise.
	* rtlhooks.c: Likewise.
	* sanopt.c: Likewise.
	* sched-deps.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-rgn.c: Likewise.
	* sdbout.c: Likewise.
	* sel-sched-dump.c: Likewise.
	* sel-sched-ir.c: Likewise.
	* sel-sched.c: Likewise.
	* sese.c: Likewise.
	* shrink-wrap.c: Likewise.
	* simplify-rtx.c: Likewise.
	* stack-ptr-mod.c: Likewise.
	* statistics.c: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* store-motion.c: Likewise.
	* stringpool.c: Likewise.
	* symtab.c: Likewise.
	* target-globals.c: Likewise.
	* targhooks.c: Likewise.
	* toplev.c: Likewise.
	* tracer.c: Likewise.
	* trans-mem.c: Likewise.
	* tree-affine.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-chkp-opt.c: Likewise.
	* tree-chkp.c: Likewise.
	* tree-chrec.c: Likewise.
	* tree-complex.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-diagnostic.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-iterator.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-ifcombine.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-loop-ch.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-loop-unswitch.c: Likewise.
	* tree-ssa-loop.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-operands.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-scopedtables.c: Likewise.
	* tree-ssa-sink.c: Likewise.
	* tree-ssa-strlen.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-tail-merge.c: Likewise.
	* tree-ssa-ter.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-stdarg.c: Likewise.
	* tree-streamer-in.c: Likewise.
	* tree-streamer-out.c: Likewise.
	* tree-streamer.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-tailcall.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-generic.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-vectorizer.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.
	* tsan.c: Likewise.
	* ubsan.c: Likewise.
	* value-prof.c: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.
	* varpool.c: Likewise.
	* vmsdbgout.c: Likewise.
	* vtable-verify.c: Likewise.
	* web.c: Likewise.
	* wide-int-print.cc: Likewise.
	* wide-int.cc: Likewise.
	* xcoffout.c: Likewise.

From-SVN: r229585
2015-10-30 15:48:59 +00:00
Andrew MacLeod 957060b5c5 alias.c: Reorder #include statements and remove duplicates.
2015-10-29  Andrew MacLeod  <amacleod@redhat.com>

	* alias.c: Reorder #include statements and remove duplicates.
	* asan.c: Likewise.
	* attribs.c: Likewise.
	* auto-inc-dec.c: Likewise.
	* auto-profile.c: Likewise.
	* bb-reorder.c: Likewise.
	* bt-load.c: Likewise.
	* builtins.c: Likewise.
	* caller-save.c: Likewise.
	* calls.c: Likewise.
	* ccmp.c: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfgexpand.c: Likewise.
	* cfghooks.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgloopanal.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.c: Likewise.
	* cgraphbuild.c: Likewise.
	* cgraphclones.c: Likewise.
	* cgraphunit.c: Likewise.
	* cilk-common.c: Likewise.
	* combine-stack-adj.c: Likewise.
	* combine.c: Likewise.
	* compare-elim.c: Likewise.
	* convert.c: Likewise.
	* coverage.c: Likewise.
	* cppbuiltin.c: Likewise.
	* cprop.c: Likewise.
	* cse.c: Likewise.
	* cselib.c: Likewise.
	* data-streamer-in.c: Likewise.
	* data-streamer-out.c: Likewise.
	* data-streamer.c: Likewise.
	* dbxout.c: Likewise.
	* dce.c: Likewise.
	* ddg.c: Likewise.
	* debug.c: Likewise.
	* df-core.c: Likewise.
	* df-problems.c: Likewise.
	* df-scan.c: Likewise.
	* dfp.c: Likewise.
	* dojump.c: Likewise.
	* dominance.c: Likewise.
	* double-int.c: Likewise.
	* dse.c: Likewise.
	* dumpfile.c: Likewise.
	* dwarf2asm.c: Likewise.
	* dwarf2cfi.c: Likewise.
	* dwarf2out.c: Likewise.
	* emit-rtl.c: Likewise.
	* except.c: Likewise.
	* explow.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* final.c: Likewise.
	* fixed-value.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* fwprop.c: Likewise.
	* gcse.c: Likewise.
	* generic-match-head.c: Likewise.
	* ggc-common.c: Likewise.
	* gimple-builder.c: Likewise.
	* gimple-expr.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-iterator.c: Likewise.
	* gimple-low.c: Likewise.
	* gimple-match-head.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* gimple-ssa-isolate-paths.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimple-streamer-in.c: Likewise.
	* gimple-streamer-out.c: Likewise.
	* gimple-walk.c: Likewise.
	* gimple.c: Likewise.
	* gimplify-me.c: Likewise.
	* gimplify.c: Likewise.
	* godump.c: Likewise.
	* graph.c: Likewise.
	* graphite-poly.c: Likewise.
	* haifa-sched.c: Likewise.
	* hw-doloop.c: Likewise.
	* ifcvt.c: Likewise.
	* incpath.c: Likewise.
	* init-regs.c: Likewise.
	* internal-fn.c: Likewise.
	* ipa-chkp.c: Likewise.
	* ipa-comdats.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-icf-gimple.c: Likewise.
	* ipa-icf.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* ipa-inline-transform.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-polymorphic-call.c: Likewise.
	* ipa-profile.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-ref.c: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa-visibility.c: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-conflicts.c: Likewise.
	* ira-costs.c: Likewise.
	* ira-emit.c: Likewise.
	* ira-lives.c: Likewise.
	* ira.c: Likewise.
	* jump.c: Likewise.
	* langhooks.c: Likewise.
	* lcm.c: Likewise.
	* lists.c: Likewise.
	* loop-doloop.c: Likewise.
	* loop-init.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-iv.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lra-assigns.c: Likewise.
	* lra-coalesce.c: Likewise.
	* lra-constraints.c: Likewise.
	* lra-eliminations.c: Likewise.
	* lra-lives.c: Likewise.
	* lra-remat.c: Likewise.
	* lra-spills.c: Likewise.
	* lra.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-compress.c: Likewise.
	* lto-opts.c: Likewise.
	* lto-section-in.c: Likewise.
	* lto-section-out.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* mode-switching.c: Likewise.
	* modulo-sched.c: Likewise.
	* omp-low.c: Likewise.
	* optabs.c: Likewise.
	* opts-global.c: Likewise.
	* passes.c: Likewise.
	* plugin.c: Likewise.
	* postreload-gcse.c: Likewise.
	* postreload.c: Likewise.
	* predict.c: Likewise.
	* print-tree.c: Likewise.
	* profile.c: Likewise.
	* real.c: Likewise.
	* realmpfr.c: Likewise.
	* recog.c: Likewise.
	* ree.c: Likewise.
	* reg-stack.c: Likewise.
	* regcprop.c: Likewise.
	* reginfo.c: Likewise.
	* regrename.c: Likewise.
	* regstat.c: Likewise.
	* reload.c: Likewise.
	* reload1.c: Likewise.
	* reorg.c: Likewise.
	* resource.c: Likewise.
	* rtl-chkp.c: Likewise.
	* rtl-error.c: Likewise.
	* rtlanal.c: Likewise.
	* rtlhooks.c: Likewise.
	* sanopt.c: Likewise.
	* sched-deps.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-rgn.c: Likewise.
	* sese.c: Likewise.
	* shrink-wrap.c: Likewise.
	* simplify-rtx.c: Likewise.
	* stack-ptr-mod.c: Likewise.
	* statistics.c: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* store-motion.c: Likewise.
	* stringpool.c: Likewise.
	* symtab.c: Likewise.
	* target-globals.c: Likewise.
	* targhooks.c: Likewise.
	* toplev.c: Likewise.
	* tracer.c: Likewise.
	* trans-mem.c: Likewise.
	* tree-affine.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-chkp-opt.c: Likewise.
	* tree-chkp.c: Likewise.
	* tree-chrec.c: Likewise.
	* tree-complex.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-diagnostic.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-iterator.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-ifcombine.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-loop-ch.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-loop-unswitch.c: Likewise.
	* tree-ssa-loop.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-operands.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-scopedtables.c: Likewise.
	* tree-ssa-sink.c: Likewise.
	* tree-ssa-strlen.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-tail-merge.c: Likewise.
	* tree-ssa-ter.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-stdarg.c: Likewise.
	* tree-streamer-in.c: Likewise.
	* tree-streamer-out.c: Likewise.
	* tree-streamer.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-tailcall.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-generic.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-vectorizer.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.
	* tsan.c: Likewise.
	* ubsan.c: Likewise.
	* value-prof.c: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.
	* varpool.c: Likewise.
	* vtable-verify.c: Likewise.
	* web.c: Likewise.
	* wide-int-print.cc: Likewise.
	* wide-int.cc: Likewise.
	* xcoffout.c: Likewise.

From-SVN: r229526
2015-10-29 13:57:32 +00:00
Mikhail Maltsev b2b293775a [PATCH 7/9] ENABLE_CHECKING refactoring: middle-end, LTO FE
[PATCH 7/9] ENABLE_CHECKING refactoring: middle-end, LTO FE
gcc/lto/ChangeLog:
2015-10-27  Mikhail Maltsev  <maltsevm@gmail.com>

	* lto.c (unify_scc): Use flag_checking and remove ENABLE_CHECKING
	conditionals.
	(lto_fixup_state): Likewise.
	(do_whole_program_analysis): Use
	symtab_node::checking_verify_symtab_nodes and remove ENABLE_CHECKING
	conditionals.

gcc/ChangeLog:

2015-10-27  Mikhail Maltsev  <maltsevm@gmail.com>

	* attribs.c (check_attribute_tables): New function, broken out from...
	(init_attributes): Use it.
	* cfgcleanup.c (try_optimize_cfg): Use flag_checking, CHECKING_P
	gcc_checking_assert and checking_* functions to eliminate
	ENABLE_CHECKING conditionals.
	* cfgexpand.c (expand_goto, expand_debug_expr): Likewise.
	(pass_expand::execute): Likewise.
	* cgraphclones.c (symbol_table::materialize_all_clones): Likewise.
	* cgraphunit.c (mark_functions_to_output): Likewise.
	(cgraph_node::expand_thunk): Likewise.
	(symbol_table::compile): Likewise.
	* ddg.c (add_cross_iteration_register_deps): Likewise.
	(create_ddg_all_sccs): Likewise.
	* df-core.c (df_finish_pass, df_analyze): Likewise.
	* diagnostic-core.h: Likewise.
	* diagnostic.c (diagnostic_report_diagnostic): Likewise.
	* dominance.c (calculate_dominance_info): Likewise.
	* dwarf2out.c (add_AT_die_ref): Likewise.
	(const_ok_for_output_1, mem_loc_descriptor): Likewise.
	(loc_list_from_tree, gen_lexical_block_die): Likewise.
	gen_type_die_with_usage, gen_type_die): Likewise.
	(dwarf2out_decl): Likewise.
	* emit-rtl.c (verify_rtx_sharing, reorder_insns_nobb): Likewise.
	* except.c (duplicate_eh_regions): Likewise.
	* fwprop.c (register_active_defs, update_df_init): Likewise.
	(fwprop_init, fwprop_done): Likewise.
	(update_uses): Likewise.
	* ggc-page.c (ggc_grow): Likewise.
	* gimplify.c (gimplify_body): Likewise.
	(gimplify_hasher::equal): Likewise.
	* graphite-isl-ast-to-gimple.c (graphite_verify): Likewise.
	* graphite-scop-detection.c (canonicalize_loop_closed_ssa_form):
	Likewise.
	* graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa): Likewise.
	(rewrite_cross_bb_scalar_deps_out_of_ssa): Likwise.
	* hash-table.h (::find_empty_slot_for_expand): Likewise.
	* ifcvt.c (if_convert): Likewise.
	* ipa-cp.c (ipcp_propagate_stage): Likewise.
	* ipa-devirt.c (type_in_anonymous_namespace_p): Likewise.
	(odr_type_p, odr_types_equivalent_p): Likewise.
	(add_type_duplicate, get_odr_type): Likewise.
	* ipa-icf.c (sem_item_optimizer::execute): Likewise.
	(sem_item_optimizer::subdivide_classes_by_equality): Likewise.
	(sem_item_optimizer::verify_classes): Likewise.
	(sem_item_optimizer::traverse_congruence_split): Likewise.
	(sem_item_optimizer::checking_verify_classes): New.
	* ipa-icf.h (sem_item_optimizer::checking_verify_classes): Add new
	method.
	* cfgrtl.c (commit_edge_insertions): Likewise.
	(fixup_reorder_chain, cfg_layout_finalize): Likewise.
	(rtl_flow_call_edges_add): Likewise.
	* cgraph.c (symbol_table::create_edge): Likewise.
	(cgraph_edge::redirect_call_stmt_to_callee): Likewise.
	* cgraph.h (symtab_node): Likewise.
	(symtab_node::checking_verify_symtab_nodes): Define.
	(cgraph_node::checking_verify_cgraph_nodes): Define.
	* cfghooks.h (checking_verify_flow_info): Define.
	* cfgloop.h (checking_verify_loop_structure): Define.
	* dominance.h (checking_verify_dominators): Define.
	* et-forest.c: Fix comment.
	* ipa-inline-analysis.c (compute_inline_parameters): Use flag_checking,
	CHECKING_P gcc_checking_assert and checking_* functions to eliminate
	ENABLE_CHECKING conditionals.
	* ipa-inline-transform.c (save_inline_function_body): Likewise.
	* ipa-inline.c (inline_small_functions): Likewise.
	(early_inliner): Likewise.
	* ipa-inline.h (estimate_edge_growth): Likewise.
	* ipa-visibility.c (function_and_variable_visibility): Likewise.
	* ipa.c (symbol_table::remove_unreachable_nodes): Likewise.
	(ipa_single_use): Likewise.
	* ira-int.h: Likewise.
	* ira.c (ira): Likewise.
	* loop-doloop.c (doloop_optimize_loops): Likewise.
	* loop-init.c (loop_optimizer_init, fix_loop_structure): Likewise.
	* loop-invariant.c (move_loop_invariants): Likewise.
	* lra-assigns.c (lra_assign): Likewise.
	* lra-constraints.c (lra_constraints): Likewise.
	* lra-eliminations.c (lra_eliminate): Likewise.
	* lra-int.h (struct lra_reg): Likewise.
	* lra-lives.c (check_pseudos_live_through_calls): Likewise.
	(lra_create_live_ranges_1): Likewise.
	* lra-remat.c (create_remat_bb_data): Likewise.
	* lra.c (lra_update_insn_recog_data, restore_scratches): Likewise.
	(lra): Likewise.
	(check_rtl): Always define. Remove incorrect guard around
	extract_constrain_insn call.
	* lto-cgraph.c (input_cgraph_1: Use flag_checking,
	CHECKING_P gcc_checking_assert and checking_* functions to eliminate
	ENABLE_CHECKING conditionals.
	* lto-streamer-out.c (DFS::DFS): Likewise.
	(lto_output): Likewise.
	* lto-streamer.c (lto_streamer_init): Likewise.
	* omp-low.c (scan_omp_target, expand_omp_taskreg): Likewise.
	expand_omp_target, execute_expand_omp): Likewise.
	(lower_omp_target): Likewise.
	* passes.c (execute_function_todo): Likewise.
	(execute_todo, execute_one_pass): Likewise.
	(verify_curr_properties): Always define.
	* predict.c (tree_estimate_probability: Use flag_checking,
	CHECKING_P gcc_checking_assert and checking_* functions to eliminate
	ENABLE_CHECKING conditionals.
	(propagate_freq): Likewise.
	* pretty-print.c (pp_format): Likewise.
	* real.c (real_to_decimal_for_mode): Likewise.
	* recog.c (split_all_insns): Likewise.
	* regcprop.c (kill_value_one_regno): Likewise.
	(copy_value): Likewise.
	(validate_value_data): Define unconditionally.
	* reload.c: Fix comment.
	* timevar.c: Include options.h
	* tree-ssa.h (checking_verify_ssa): Define.
	* tree-ssa-loop-manip.h (checking_verify_loop_closed_ssa): Define.
	* sched-deps.c (CHECK): Remove unused macro.
	(add_or_update_dep_1, sd_add_dep: Use flag_checking, CHECKING_P
	gcc_checking_assert and checking_* functions to eliminate
	ENABLE_CHECKING conditionals.
	* sel-sched-ir.c (free_regset_pool, tidy_control_flow): Likewise.
	* sel-sched.c (struct moveop_static_params): Likewise.
	(find_best_reg_for_expr, move_cond_jump): Likewise.
	(move_op_orig_expr_not_found): Likewise.
	(code_motion_process_successors, move_op): Likewise.
	* ssa-iterators.h (first_readonly_imm_use): Likewise.
	(next_readonly_imm_use): Likewise.
	* store-motion.c (compute_store_table): Likewise.
	* symbol-summary.h (function_summary::function_summary): Likewise.
	* target.h (cumulative_args_t): Likewise.
	(get_cumulative_args, pack_cumulative_args): Likewise.
	* timevar.c: (timer::print): Likewise.
	* trans-mem.c (ipa_tm_execute): Likewise.
	* tree-cfg.c (move_stmt_op): Likewise.
	(move_sese_region_to_fn): Likewise.
	(gimple_flow_call_edges_add): Likewise.
	* tree-cfgcleanup.c (cleanup_tree_cfg_noloop, repair_loop_structures):
	Likewise.
	* tree-eh.c (remove_unreachable_handlers): Likewise.
	* tree-if-conv.c (pass_if_conversion::execute): Likewise.
	* tree-inline.c (expand_call_inline, optimize_inline_calls): Likewise.
	* tree-into-ssa.c (update_ssa): Likewise.
	* tree-loop-distribution.c (pass_loop_distribution::execute): Likewise.
	* tree-outof-ssa.c (eliminate_useless_phis, rewrite_trees): Likewise.
	* tree-parloops.c (pass_parallelize_loops::execute): Likewise.
	* tree-predcom.c (suitable_component_p): Likewise.
	* tree-profile.c (gimple_gen_const_delta_profiler): Likewise.
	* tree-ssa-alias.c (refs_may_alias_p_1): Likewise.
	* tree-ssa-live.c (verify_live_on_entry): Likewise.
	* tree-ssa-live.h (register_ssa_partition): Likewise.
	* tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely): Likewise.
	* tree-ssa-loop-manip.c (add_exit_phi): Likewise.
	(tree_transform_and_unroll_loop): Likewise.
	* tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Likewise.
	* tree-ssa-operands.c (get_expr_operands): Likewise.
	* tree-ssa-propagate.c (replace_exp_1): Likewise.
	* tree-ssa-structalias.c (rewrite_constraints): Likewise.
	* tree-ssa-ter.c (free_temp_expr_table): Likewise.
	* tree-ssa-threadupdate.c (duplicate_thread_path): Likewise.
	* tree-ssanames.c (release_ssa_name_fn): Likewise.
	* tree-stdarg.c (expand_ifn_va_arg): Likewise.
	* tree-vect-loop-manip.c
	(slpeel_tree_duplicate_loop_to_edge_cfg): Likewise.
	(slpeel_checking_verify_cfg_after_peeling): Likewise.
	(vect_do_peeling_for_loop_bound): Likewise.
	(vect_do_peeling_for_alignment): Likewise.
	* tree-vrp.c (supports_overflow_infinity): Likewise.
	(set_value_range): Likewise.
	* tree.c (free_lang_data_in_cgraph): Likewise.
	* value-prof.c (gimple_remove_histogram_value): Likewise.
	(free_hist): Likewise.
	* var-tracking.c (canonicalize_values_star): Likewise.
	(compute_bb_dataflow, vt_find_locations, vt_emit_notes): Likewise.

From-SVN: r229470
2015-10-27 19:05:53 -06:00
Trevor Saunders 526ceb6836 remove many typedefs
gcc/ChangeLog:

2015-10-01  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* cfganal.c, compare-elim.c, coverage.c, cprop.c, df-scan.c,
	function.c, read-rtl.c, statistics.c, trans-mem.c, tree-if-conv.c,
	tree-into-ssa.c, tree-loop-distribution.c, tree-ssa-coalesce.c,
	tree-ssa-loop-ivopts.c, tree-ssa-reassoc.c, tree-ssa-strlen.c,
	tree-ssa-tail-merge.c, tree-vrp.c, var-tracking.c: Remove
unneeded typedefs.

From-SVN: r228344
2015-10-01 15:12:31 +00:00
Trevor Saunders 355fe0884b switch from gimple to gimple*
This renames the gimple_statement_base struct to gimple removes the
typedef of gimple_statement_base * to gimple, and then adjusts all of
the places that use the type.

gcc/ChangeLog:

2015-09-19  Trevor Saunders  <tbsaunde@tbsaunde.org>

	* coretypes.h (gimple): Change typedef to be a forward
	declaration.
	* gimple.h (gimple_statement_base): rename to gimple.
	* (all functions and types using gimple): Adjust.
	* *.[ch]: Likewise.

gcc/cp/ChangeLog:

2015-09-19  Trevor Saunders  <tbsaunde@tbsaunde.org>

	* cp-gimplify.c (gimplify_must_not_throw_expr): Adjust.

From-SVN: r227941
2015-09-20 00:52:59 +00:00