aboutsummaryrefslogtreecommitdiff
path: root/gcc/match.pd
AgeCommit message (Collapse)AuthorFilesLines
2015-05-26fold-const.c (fold_binary_loc): Move X % -Y -> X % Y and X % C -> X & (C - ↵Richard Biener1-0/+24
1) for C being a power-of two to ... 2015-05-26 Richard Biener <rguenther@suse.de> * fold-const.c (fold_binary_loc): Move X % -Y -> X % Y and X % C -> X & (C - 1) for C being a power-of two to ... * match.pd: ... patterns. From-SVN: r223690
2015-05-26match.pd (swapped_tcc_comparison): New operator list.Marc Glisse1-0/+20
2015-05-26 Marc Glisse <marc.glisse@inria.fr> * match.pd (swapped_tcc_comparison): New operator list. (-A CMP -B): New simplification. * fold-const.c (fold_comparison): Remove corresponding code. From-SVN: r223689
2015-05-22re PR other/63387 (Optimize pairs of isnan() calls into a single isunordered())Marc Glisse1-2/+8
2015-05-22 Marc Glisse <marc.glisse@inria.fr> PR tree-optimization/63387 gcc/ * match.pd ((X /[ex] A) * A -> X): Remove unnecessary condition. ((x ord x) & (y ord y) -> (x ord y), (x ord x) & (x ord y) -> (x ord y)): New simplifications. * fold-const.c (tree_unary_nonnegative_warnv_p) <ABS_EXPR>: Handle vectors like scalars. gcc/testsuite/ * gcc.dg/pr63387-2.c: New testcase. From-SVN: r223591
2015-05-22match.pd ((x | y) & ~x -> y & ~x, (x & y) | ~x -> y | ~x): New simplifications.Marc Glisse1-4/+12
2015-05-22 Marc Glisse <marc.glisse@inria.fr> gcc/ * match.pd ((x | y) & ~x -> y & ~x, (x & y) | ~x -> y | ~x): New simplifications. gcc/testsuite/ * gcc.dg/nand.c: New testcase. From-SVN: r223587
2015-05-21re PR tree-optimization/66233 (internal compiler error: in expand_fix, at ↵Jakub Jelinek1-9/+5
optabs.c:5358) PR tree-optimization/66233 * match.pd (ocvt (icvt@1 @0)): Don't handle vector types. Simplify. * gcc.c-torture/execute/pr66233.c: New test. From-SVN: r223500
2015-05-21re PR c++/66211 (Rvalue conversion in ternary operator causes internal ↵Richard Biener1-1/+2
compiler error) 2015-05-21 Richard Biener <rguenther@suse.de> PR c++/66211 * match.pd: Guard pattern optimzing (int)(float)int conversions to apply only on GIMPLE. * g++.dg/conversion/pr66211.C: New testcase. * gcc.dg/tree-ssa/forwprop-18.c: Adjust. From-SVN: r223483
2015-05-19re PR rtl-optimization/66187 (wrong code at -O1, -O2 and -O3 on ↵Jakub Jelinek1-1/+3
x86_64-linux-gnu) PR tree-optimization/66187 * match.pd ((bit_and (plus/minus (convert @0) (convert @1)) mask)): Pass TYPE_SIGN to tree_int_cst_min_precision. If !TYPE_OVERFLOW_WRAPS, ensure @4 is non-negative. * gcc.c-torture/execute/pr66187.c: New test. * gcc.dg/pr66187-1.c: New test. * gcc.dg/pr66187-2.c: New test. From-SVN: r223366
2015-05-15re PR tree-optimization/64454 (optimize (x%5)%5)Marc Glisse1-3/+18
2015-05-15 Marc Glisse <marc.glisse@inria.fr> PR tree-optimization/64454 gcc/ * match.pd ((X % Y) % Y, (X % Y) < Y): New patterns. (-1 - A -> ~A): Remove unnecessary condition. gcc/testsuite/ * gcc.dg/modmod.c: New testcase. From-SVN: r223221
2015-05-14generic-match-head.c (types_match): Handle non-types.Marc Glisse1-5/+5
2015-05-14 Marc Glisse <marc.glisse@inria.fr> gcc/ * generic-match-head.c (types_match): Handle non-types. * gimple-match-head.c (types_match): Likewise. * match.pd: Remove unnecessary TREE_TYPE for types_match. From-SVN: r223199
2015-05-07match.pd (bit_and (plus/minus (convert @0) (convert @1) mask): New ↵Jeff Law1-13/+41
simplifier to narrow arithmetic. * match.pd (bit_and (plus/minus (convert @0) (convert @1) mask): New simplifier to narrow arithmetic. * generic-match-head.c: (types_match, single_use): New functions. * gimple-match-head.c: (types_match, single_use): New functions. * gcc.dg/tree-ssa/shorten-1.c: New test. From-SVN: r222877
2015-05-04Revert:Jeff Law1-41/+13
2015-05-04 Jeff Law <law@redhat.com> * match.pd (bit_and (plus/minus (convert @0) (convert @1) mask): New simplifier to narrow arithmetic. * generic-match-head.c: (types_match, single_use): New functions. * gimple-match-head.c: (types_match, single_use): New functions. Revert: 2015-05-04 Jeff Law <law@redhat.com> * gcc.dg/tree-ssa/shorten-1.c: New test. From-SVN: r222784
2015-05-04match.pd (bit_and (plus/minus (convert @0) (convert @1) mask): New ↵Jeff Law1-13/+41
simplifier to narrow arithmetic. * match.pd (bit_and (plus/minus (convert @0) (convert @1) mask): New simplifier to narrow arithmetic. * generic-match-head.c: (types_match, single_use): New functions. * gimple-match-head.c: (types_match, single_use): New functions. * gcc.dg/tree-ssa/shorten-1.c: New test. From-SVN: r222771
2015-05-01match.pd: New simplification patterns.Rasmus Villemoes1-0/+14
* match.pd: New simplification patterns. (x + (x & 1)) -> ((x + 1) & ~1) (x & ~(x & y)) -> ((x & ~y)) (x | ~(x | y)) -> ((x | ~y)) * gcc.dg/20150120-1.c: New test. * gcc.dg/20150120-2.c: New test. * gcc.dg/20150120-3.c: New test. From-SVN: r222697
2015-04-14re PR other/63387 (Optimize pairs of isnan() calls into a single isunordered())Marc Glisse1-0/+9
2015-04-14 Marc Glisse <marc.glisse@inria.fr> PR tree-optimization/63387 gcc/ * match.pd ((x unord x) | (y unord y) -> (x unord y), (x unord x) | (x unord y) -> (x unord y)): New simplifications. gcc/testsuite/ * gcc.dg/pr63387.c: New testcase. From-SVN: r222077
2015-02-13re PR rtl-optimization/47477 (Sub-optimal mov at end of method)Jeff Law1-0/+41
PR rtl-optimization/47477 * match.pd (convert (plus/minus (convert @0) (convert @1): New simplifier to narrow arithmetic. PR rtl-optimization/47477 * gcc.dg/tree-ssa/pr47477.c: New test. From-SVN: r220695
2015-01-05Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r219188
2014-12-17re PR middle-end/63568 (Missed optimization (a & ~mask) | (b & mask) = a ^ ↵Marek Polacek1-0/+7
((a ^ b) & mask)) PR middle-end/63568 * match.pd: Add (x & ~m) | (y & m) -> ((x ^ y) & m) ^ x pattern. * gcc.dg/pr63568.c: New test. From-SVN: r218816
2014-12-16re PR middle-end/64309 (if (1 & (1 << n)) not simplified to if (n == 0))Marek Polacek1-0/+7
PR middle-end/64309 * match.pd: Add ((1 << A) & 1) != 0 -> A == 0 and ((1 << A) & 1) == 0 -> A != 0. * gcc.dg/pr64309.c: New test. From-SVN: r218787
2014-12-15re PR tree-optimization/64295 (ICE: SIGSEGV (infinite recursion) with ↵Richard Biener1-1/+1
-frounding-math -funsafe-math-optimizations) 2014-12-15 Richard Biener <rguenther@suse.de> PR middle-end/64295 * match.pd (X / CST -> X * (1 / CST): Use const_binop instead of fold_binary to compute the constant to multiply with. * gcc.dg/pr64295.c: New testcase. From-SVN: r218748
2014-12-10real.h (HONOR_NANS): Replace macro with 3 overloaded declarations.Marc Glisse1-7/+6
2014-12-10 Marc Glisse <marc.glisse@inria.fr> * real.h (HONOR_NANS): Replace macro with 3 overloaded declarations. * real.c: Include rtl.h and options.h. (HONOR_NANS): Define three overloads. * builtins.c (fold_builtin_classify, fold_builtin_unordered_cmp): Simplify argument of HONOR_NANS. * fold-const.c (combine_comparisons, fold_truth_not_expr, fold_cond_expr_with_comparison, merge_truthop_with_opposite_arm, fold_comparison, fold_binary_loc): Likewise. * ifcvt.c (noce_try_move, noce_try_minmax): Likewise. * ipa-inline-analysis.c (add_clause, set_cond_stmt_execution_predicate): Likewise. * match.pd: Likewise. * rtlanal.c (may_trap_p_1): Likewise. * simplify-rtx.c (simplify_const_relational_operation): Likewise. * tree-if-conv.c (parse_predicate): Likewise. * tree-ssa-ccp.c (valid_lattice_transition): Likewise. * tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise. * tree-ssa-phiopt.c (minmax_replacement, neg_replacement): Likewise. * tree-ssa-reassoc.c (eliminate_using_constants): Likewise. * tree-ssa-tail-merge.c (gimple_equal_p): Likewise. From-SVN: r218605
2014-12-03re PR tree-optimization/14541 ([tree-ssa] built-in math functions are not ↵Richard Biener1-0/+87
fully optimized at tree level) 2014-12-03 Richard Biener <rguenther@suse.de> PR middle-end/14541 * builtins.c (fold_builtin_logarithm): Implement simplifications ... * match.pd: ... here as patterns. From-SVN: r218308
2014-12-02match.pd: When combining divisions exclude the degenerate case involving ↵Richard Biener1-1/+3
INT_MIN from... 2014-12-02 Richard Biener <rguenther@suse.de> * match.pd: When combining divisions exclude the degenerate case involving INT_MIN from overflow handling. * gcc.dg/torture/20141202-1.c: New testcase. From-SVN: r218269
2014-12-02match.pd: Restrict division combining to trunc_div and exact_div.Richard Biener1-2/+3
2014-12-02 Richard Biener <rguenther@suse.de> * match.pd: Restrict division combining to trunc_div and exact_div. From-SVN: r218260
2014-12-01re PR tree-optimization/15346 ([tree-ssa] combine two successive divisions)Richard Biener1-0/+13
2014-12-01 Richard Biener <rguenther@suse.de> PR tree-optimization/15346 * Makefile.in (gimple-match.o-warn): Remove -Wno-unused-parameter, add -Wno-unused-but-set-variable. * match.pd: Combine two successive divisions. * gcc.dg/tree-ssa/forwprop-32.c: New testcase. From-SVN: r218211
2014-12-01re PR tree-optimization/64126 (FAIL: gcc.dg/pr37289.c scan-tree-dump ↵Richard Biener1-2/+16
original "-\\(long unsigned int\\) x") 2014-12-01 Richard Biener <rguenther@suse.de> PR middle-end/64126 * match.pd: Allow conversions in ~A + 1 -> -A, add -A - 1 -> ~A and -1 - A -> ~A. * fold-const.c (fold_binary_loc): Remove transforms here. From-SVN: r218210
2014-11-20re PR tree-optimization/63962 ([x86] Code pessimization after r217213)Richard Biener1-2/+3
2014-11-20 Richard Biener <rguenther@suse.de> PR middle-end/63962 * match.pd ((p +p off1) +p off2 -> (p +p (off1 + off2))): Guard with single-use operand 0. * gcc.dg/tree-ssa/forwprop-30.c: New testcase. From-SVN: r217828
2014-11-18tree.c (element_mode, [...]): New functions.Marc Glisse1-55/+52
2014-11-18 Marc Glisse <marc.glisse@inria.fr> * tree.c (element_mode, integer_truep): New functions. * tree.h (element_mode, integer_truep): Declare them. * fold-const.c (negate_expr_p, fold_negate_expr, combine_comparisons, fold_cond_expr_with_comparison, fold_real_zero_addition_p, fold_comparison, fold_ternary_loc, tree_call_nonnegative_warnv_p, fold_strip_sign_ops): Use element_mode. (fold_binary_loc): Use element_mode and element_precision. * match.pd: Use integer_truep, element_mode, element_precision, VECTOR_TYPE_P and build_one_cst. Extend some transformations to vectors. Simplify A/-A. From-SVN: r217702
2014-11-17re PR tree-optimization/63898 (r217560 caused segfault building ↵Richard Biener1-1/+2
462.libquantum from cpu2006) 2014-11-17 Richard Biener <rguenther@suse.de> PR middle-end/63898 * match.pd: Guard X / CST -> X * CST' transform against zero CST. From-SVN: r217650
2014-11-14match.pd: Implement more binary patterns exercised by fold_stmt.Richard Biener1-9/+218
2014-11-14 Richard Biener <rguenther@suse.de> * match.pd: Implement more binary patterns exercised by fold_stmt. * fold-const.c (sing_bit_p): Export. (exact_inverse): Likewise. (fold_binary_loc): Remove patterns here. (tree_unary_nonnegative_warnv_p): Use CASE_CONVERT. * fold-const.h (sing_bit_p): Declare. (exact_inverse): Likewise. * gcc.c-torture/execute/shiftopt-1.c: XFAIL invalid parts. From-SVN: r217545
2014-11-13match.pd: Add tcc_comparison...Richard Biener1-3/+51
2014-11-13 Richard Biener <rguenther@suse.de> * match.pd: Add tcc_comparison, inverted_tcc_comparison and inverted_tcc_comparison_with_nans operator lists. Use tcc_comparison in the truth_valued_p predicate definition. Restrict logical_inverted_value with bit_xor to integral types. Build a boolean true for simplifying x |^ !x because of vector types. Implement patterns from forward_propagate_comparison * tree-ssa-forwprop.c (forward_propagate_comparison): Remove. (get_prop_dest_stmt): Likewise. (pass_forwprop::execute): Do not call it. * fold-const.c (fold_unary_loc): Remove the pattern here. * gcc.dg/tree-ssa/forwprop-28.c: Adjust. From-SVN: r217496
2014-11-13tree.h (TYPE_OVERFLOW_SANITIZED): Define.Marek Polacek1-9/+3
* tree.h (TYPE_OVERFLOW_SANITIZED): Define. * fold-const.c (fold_binary_loc): Use it. * match.pd: Likewise. From-SVN: r217470
2014-11-13match.pd: Implement conditional expression patterns.Richard Biener1-0/+48
2014-11-13 Richard Biener <rguenther@suse.de> * match.pd: Implement conditional expression patterns. * tree-ssa-forwprop.c (forward_propagate_into_cond): Remove them here. (combine_cond_exprs): Remove. (pass_forwprop::execute): Do not call combine_cond_exprs. * fold-const.c (fold_ternary_loc): Remove patterns here. (pedantic_omit_one_operand_loc): Remove. From-SVN: r217465
2014-11-13re PR tree-optimization/61559 (FAIL: gcc.dg/builtin-bswap-8.c on i686 with ↵Richard Biener1-0/+14
-mmovbe) 2014-12-13 Richard Biener <rguenther@suse.de> PR middle-end/61559 * match.pd: Implement bswap patterns for transforms checked by gcc.dg/builtin-bswap-8.c. From-SVN: r217464
2014-11-12fold-const.c (fold_binary_loc): Don't fold if the result is undefined.Marek Polacek1-3/+9
* fold-const.c (fold_binary_loc): Don't fold if the result is undefined. * match.pd (A + (-B) -> A - B, A - (-B) -> A + B, -(-A) -> A): Likewise. * c-c++-common/ubsan/overflow-sub-4.c: New test. * c-c++-common/ubsan/overflow-sub-2.c: Adjust dg-output. * c-c++-common/ubsan/overflow-int128.c: Likewise. From-SVN: r217427
2014-11-12match.pd: Implement simple complex operations cancelling.Richard Biener1-0/+12
2014-11-12 Richard Biener <rguenther@suse.de> * match.pd: Implement simple complex operations cancelling. * fold-const.c (fold_unary_loc): Remove them here. * gcc.dg/tree-ssa/ssa-fre-32.c: Disable forwprop. From-SVN: r217421
2014-11-12re PR bootstrap/63821 (ICE in verify_gimple during libgcc build starting ↵Richard Biener1-1/+1
with r217349) 2014-11-12 Richard Biener <rguenther@suse.de> PR middle-end/63821 * match.pd: Add missing conversion to the -(T)-X pattern. * gfortran.dg/pr63821.f90: New testcase. From-SVN: r217411
2014-11-11match.pd: Implement patterns from associate_plusminus and factor in ↵Richard Biener1-6/+113
differences from the... 2014-11-11 Richard Biener <rguenther@suse.de> * match.pd: Implement patterns from associate_plusminus and factor in differences from the fold-const.c implementation. * fold-const.c (fold_binary_loc): Remove patterns here. * tree-ssa-forwprop.c (associate_plusminus): Remove. (pass_forwprop::execute): Don't call it. * tree.c (tree_nop_conversion_p): New function, factored from tree_nop_conversion. * tree.h (tree_nop_conversion_p): Declare. From-SVN: r217349
2014-11-10match.pd: Implement pattern from simplify_mult.Richard Biener1-0/+8
2014-11-10 Richard Biener <rguenther@suse.de> * match.pd: Implement pattern from simplify_mult. * tree-ssa-forwprop.c (simplify_mult): Remove. (pass_forwprop::execute): Do not call simplify_mult. From-SVN: r217290
2014-11-10match.pd: Implement pattern from simplify_conversion_from_bitmask.Richard Biener1-0/+12
2014-11-10 Richard Biener <rguenther@suse.de> * match.pd: Implement pattern from simplify_conversion_from_bitmask. * tree-ssa-forwprop.c (simplify_conversion_from_bitmask): Remove. (pass_forwprop::execute): Do not call simplify_conversion_from_bitmask. From-SVN: r217284
2014-11-10match.pd: Move rest of the conversion combining patterns from ↵Richard Biener1-1/+20
tree-ssa-forwprop.c. 2014-11-10 Richard Biener <rguenther@suse.de> * match.pd: Move rest of the conversion combining patterns from tree-ssa-forwprop.c. * tree-ssa-forwprop.c (combine_conversions): Remove. (pass_forwprop::execute): Do not call it. From-SVN: r217279
2014-11-09match.pd: Add patterns convering two conversions in a row from fold-const.c.Richard Biener1-0/+93
2014-11-09 Richard Biener <rguenther@suse.de> * match.pd: Add patterns convering two conversions in a row from fold-const.c. * fold-const.c (fold_unary_loc): Remove them here. * tree-ssa-forwprop.c (combine_conversions): Likewise. * genmatch.c (dt_node::gen_kids): Check whether we may follow SSA use-def chains. * g++.dg/cpp0x/constexpr-reinterpret1.C: XFAIL. * gcc.dg/tree-ssa/pr21031.c: XFAIL. From-SVN: r217260
2014-11-07re PR middle-end/63770 (ICE on valid code at all optimization levels on ↵Richard Biener1-8/+9
x86_64-linux-gnu) 2014-11-07 Richard Biener <rguenther@suse.de> PR middle-end/63770 * match.pd: Guard conflicting GENERIC pattern properly. * gcc.dg/pr63770.c: New testcase. From-SVN: r217214
2014-11-07match.pd: Add patterns for POINTER_PLUS_EXPR association and special ↵Richard Biener1-3/+39
patterns from... 2014-11-07 Richard Biener <rguenther@suse.de> * match.pd: Add patterns for POINTER_PLUS_EXPR association and special patterns from tree-ssa-forwprop.c * fold-const.c (fold_binary_loc): Remove them here. * tree-ssa-forwprop.c (to_purge): New global bitmap. (fwprop_set_lattice_val): New function. (fwprop_invalidate_lattice): Likewise. (remove_prop_source_from_use): Instead of purging dead EH edges record blocks to do that in to_purge. (tidy_after_forward_propagate_addr): Likewise. (forward_propagate_addr_expr): Invalidate the lattice for SSA names we release. (simplify_conversion_from_bitmask): Likewise. (simplify_builtin_call): Likewise. (associate_pointerplus_align): Remove. (associate_pointerplus_diff): Likewise. (associate_pointerplus): Likewise. (fold_all_stmts): Merge with ... (pass_forwprop::execute): ... the original loop over all basic-blocks. Delay purging dead EH edges and invalidate the lattice for SSA names we release. From-SVN: r217213
2014-11-06match.pd: Implement bitwise binary and unary simplifications from ↵Richard Biener1-0/+128
tree-ssa-forwprop.c. 2014-11-06 Richard Biener <rguenther@suse.de> * match.pd: Implement bitwise binary and unary simplifications from tree-ssa-forwprop.c. * fold-const.c (fold_unary_loc): Remove them here. (fold_binary_loc): Likewise. * tree-ssa-forwprop.c (simplify_not_neg_expr): Remove. (truth_valued_ssa_name): Likewise. (lookup_logical_inverted_value): Likewise. (simplify_bitwise_binary_1): Likewise. (hoist_conversion_for_bitop_p): Likewise. (simplify_bitwise_binary_boolean): Likewise. (simplify_bitwise_binary): Likewise. (pass_forwprop::execute): Remove calls to simplify_not_neg_expr and simplify_bitwise_binary. * genmatch.c (dt_node::append_true_op): Use safe_as_a for parent. (decision_tree::insert): Also insert non-expressions. * gcc.dg/tree-ssa/forwprop-28.c: Adjust scanning for the desired transform. From-SVN: r217178
2014-11-03match.pd: Add two abs patterns.Richard Biener1-2/+10
2014-11-03 Richard Biener <rguenther@suse.de> * match.pd: Add two abs patterns. Announce tree_expr_nonnegative_p. Also drop bogus FLOAT_EXPR and FIX_TRUNC_EXPR. * fold-const.c (fold_unary_loc): Remove them here. (tree_unary_nonnegative_warnv_p): Use CASE_CONVERT. * gimple-fold.c (fold_gimple_assign): Remove now obsolete GIMPLE_UNARY_RHS case. (gimple_fold_stmt_to_constant_1): Likewise. (replace_stmt_with_simplification): Fix inverted comparison. From-SVN: r217039
2014-10-30match.pd: Implement more patterns that simplify to a single value.Richard Biener1-1/+17
2014-10-30 Richard Biener <rguenther@suse.de> * match.pd: Implement more patterns that simplify to a single value. * fold-const.c (fold_binary_loc): Remove them here. * tree-ssa-forwprop.c (simplify_bitwise_binary): Likewise. (fwprop_ssa_val): Remove restriction on single uses. From-SVN: r216933
2014-10-29match.pd: Implement a first set of conversion patterns.Richard Biener1-0/+42
2014-10-29 Richard Biener <rguenther@suse.de> * match.pd: Implement a first set of conversion patterns. * fold-const.c (fold_unary_loc): Remove them here. * tree-ssa-forwprop.c (simplify_vce): Remove. (pass_forwprop::execute): Do not call simplify_vce. From-SVN: r216839
2014-10-27match.pd (0 % X): Properly use the iterator iterating over all modulo operators.Richard Biener1-2/+2
2014-10-27 Richard Biener <rguenther@suse.de> * match.pd (0 % X): Properly use the iterator iterating over all modulo operators. (X % 1): Likewise. From-SVN: r216732
2014-10-24genmatch.c (expr::gen_transform): Use fold_buildN_loc and build_call_expr_loc.Richard Biener1-0/+60
2014-10-24 Richard Biener <rguenther@suse.de> * genmatch.c (expr::gen_transform): Use fold_buildN_loc and build_call_expr_loc. (dt_simplify::gen): Drop non_lvalue for GIMPLE, use non_lvalue_loc to build it for GENERIC. (decision_tree::gen_generic): Add location argument to generic_simplify prototype. (capture_info): New class. (capture_info::capture_info): New constructor. (capture_info::walk_match): New method. (capture_info::walk_result): New method. (capture_info::walk_c_expr): New method. (dt_simplify::gen): Handle preserving side-effects for GENERIC code generation. (decision_tree::gen_generic): Do not reject operands with TREE_SIDE_EFFECTS. * generic-match.h: New file. * generic-match-head.c: Include generic-match.h, not gimple-match.h. * match.pd: Add some constant folding patterns from fold-const.c. * fold-const.c: Include generic-match.h. (fold_unary_loc): Dispatch to generic_simplify. (fold_ternary_loc): Likewise. (fold_binary_loc): Likewise. Remove patterns now implemented by generic_simplify. * gimple-fold.c (replace_stmt_with_simplification): New function. (fold_stmt_1): Add valueize parameter, dispatch to gimple_simplify. (no_follow_ssa_edges): New function. (fold_stmt): New overload with valueization hook. Use no_follow_ssa_edges for the overload without hook. (fold_stmt_inplace): Likewise. * gimple-fold.h (no_follow_ssa_edges): Declare. From-SVN: r216631
2014-10-22Makefile.in (OBJS): Add gimple-match.o and generic-match.o.Richard Biener1-0/+30
2014-10-22 Richard Biener <rguenther@suse.de> Prathamesh Kulkarni <bilbotheelffriend@gmail.com> * Makefile.in (OBJS): Add gimple-match.o and generic-match.o. (MOSTLYCLEANFILES): Add gimple-match.c and generic-match.c. (gimple-match.c): Generate by triggering s-match. (generic-match.c): Likewise. (s-match): Rule to build gimple-match.c and generic-match.c by running the genmatch generator program. (build/hash-table.o): Dependencies to build hash-table.c for the host. (build/genmatch.o): Dependencies to build genmatch. (genprog): Add match. (build/genmatch): Likewise. (TEXI_GCCINT_FILES): Add match-and-simplify.texi. * generic-match-head.c: New file. * gimple-match-head.c: Likewise. * gimple-match.h: Likewise. * genmatch.c: Likewise. * match.pd: Likewise. * builtins.h (fold_builtin_n): Export. * builtins.c (fold_builtin_n): Likewise. * gimple-fold.h (gimple_build): Declare various overloads. (gimple_simplify): Likewise. (gimple_convert): Re-implement in terms of gimple_build. * gimple-fold.c (gimple_convert): Remove. (gimple_build): New functions. * doc/match-and-simplify.texi: New file. * doc/gccint.texi: Add menu item Match and Simplify and include match-and-simplify.texi. Co-Authored-By: Prathamesh Kulkarni <bilbotheelffriend@gmail.com> From-SVN: r216542