tree-ssa-sccvn.c (vn_nary_op_compute_hash): Also canonicalize comparison operand...
authorRichard Biener <rguenth@gcc.gnu.org>
Thu, 13 Aug 2015 07:52:06 +0000 (07:52 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 13 Aug 2015 07:52:06 +0000 (07:52 +0000)
commit89711ff6cbe5455fb5f4b42038e072d764b30579
treecbd5db5047b994e2bedcf1c6beb4048214b7af95
parent43eb7f8acdf8ce81e5bb4934744be21f3587b115
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.

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

From-SVN: r226852
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-47.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-48.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-49.c [new file with mode: 0644]