fold-const.c (fold_cond_expr_with_comparison): Move simplification for A cmp C1 ...
authorBin Cheng <bin.cheng@arm.com>
Wed, 23 Nov 2016 12:44:08 +0000 (12:44 +0000)
committerBin Cheng <amker@gcc.gnu.org>
Wed, 23 Nov 2016 12:44:08 +0000 (12:44 +0000)
commitb54819879e0518b3f1acc5242f9c1d86dd1b9e3c
treedb5d291195258e1f26c23a15aa79a6d86dbc1de4
parentb8d89b03db5f212919e4571671ebb4f5f8b1e19d
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
gcc/ChangeLog
gcc/fold-const.c
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/fold-cond_expr-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/fold-condcmpconv-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/fold-condcmpconv-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/pr66726.c
gcc/tree-if-conv.c