tree-ssa-sccvn.c (vn_nary_op_compute_hash): Also canonicalize comparison operand...
authorRichard Biener <rguenther@suse.de>
Wed, 12 Aug 2015 14:27:40 +0000 (14:27 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 12 Aug 2015 14:27:40 +0000 (14:27 +0000)
commit7fd9012e478d7f759500bfa32ace358227853c2b
treeaca7b04ebfc6e0072000a94b403cb157edf421d6
parentc0ba5a8b0cd64aa0d1024756bdf2c095199f289c
tree-ssa-sccvn.c (vn_nary_op_compute_hash): Also canonicalize comparison operand order and commutative ternary op operand order.

2015-08-12  Richard Biener  <rguenther@suse.de>

* tree-ssa-sccvn.c (vn_nary_op_compute_hash): Also canonicalize
comparison operand order and commutative ternary op operand order.
(sccvn_dom_walker::cond_stack): New state to track temporary
expressions.
(sccvn_dom_walker::after_dom_children): Remove tempoary expressions
no longer valid.
(sccvn_dom_walker::record_cond): Add a single temporary conditional
expression.
(sccvn_dom_walker::record_conds): Add a temporary conditional
expressions and all related expressions also true/false.
(sccvn_dom_walker::before_dom_children): Record temporary
expressions based on the controlling condition of a single
predecessor.  When trying to simplify a conditional statement
lookup expressions we might have inserted earlier.

* gcc.dg/tree-ssa/ssa-fre-47.c: New testcase.
* gcc.dg/tree-ssa/ssa-fre-48.c: Likewise.
* gcc.dg/tree-ssa/ssa-fre-49.c: Likewise.
* g++.dg/tree-ssa/pr61034.C: Adjust.
* gcc.dg/fold-compare-2.c: Likewise.
* gcc.dg/pr50763.c: Likewise.
* gcc.dg/predict-3.c: Likewise.
* gcc.dg/tree-ssa/20030709-2.c: Likewise.
* gcc.dg/tree-ssa/pr19831-3.c: Likewise.
* gcc.dg/tree-ssa/pr20657.c: Likewise.
* gcc.dg/tree-ssa/pr21001.c: Likewise.
* gcc.dg/tree-ssa/pr37508.c: Likewise.
* gcc.dg/tree-ssa/vrp04.c: Likewise.
* gcc.dg/tree-ssa/vrp07.c: Likewise.
* gcc.dg/tree-ssa/vrp09.c: Likewise.
* gcc.dg/tree-ssa/vrp16.c: Likewise.
* gcc.dg/tree-ssa/vrp20.c: Likewise.
* gcc.dg/tree-ssa/vrp25.c: Likewise.
* gcc.dg/tree-ssa/vrp87.c: Likewise.

From-SVN: r226814
19 files changed:
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr61034.C
gcc/testsuite/gcc.dg/fold-compare-2.c
gcc/testsuite/gcc.dg/pr50763.c
gcc/testsuite/gcc.dg/predict-3.c
gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c
gcc/testsuite/gcc.dg/tree-ssa/pr19831-3.c
gcc/testsuite/gcc.dg/tree-ssa/pr20657.c
gcc/testsuite/gcc.dg/tree-ssa/pr21001.c
gcc/testsuite/gcc.dg/tree-ssa/pr37508.c
gcc/testsuite/gcc.dg/tree-ssa/vrp04.c
gcc/testsuite/gcc.dg/tree-ssa/vrp07.c
gcc/testsuite/gcc.dg/tree-ssa/vrp09.c
gcc/testsuite/gcc.dg/tree-ssa/vrp16.c
gcc/testsuite/gcc.dg/tree-ssa/vrp20.c
gcc/testsuite/gcc.dg/tree-ssa/vrp25.c
gcc/testsuite/gcc.dg/tree-ssa/vrp87.c
gcc/tree-ssa-sccvn.c