diff mbox

[match-and-simplify] Allow SCCVN to follow SSA use-def chains

Message ID alpine.LSU.2.11.1410291016320.19560@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener Oct. 29, 2014, 9:17 a.m. UTC
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2014-10-29  Richard Biener  <rguenther@suse.de>

	* tree-ssa-sccvn.c (try_to_simplify): Allow
	gimple_fold_stmt_to_constant_1 to follow SSA use-def chains.
	(visit_use): Likewise.
diff mbox

Patch

Index: gcc/tree-ssa-sccvn.c
===================================================================
--- gcc/tree-ssa-sccvn.c	(revision 216798)
+++ gcc/tree-ssa-sccvn.c	(working copy)
@@ -3113,7 +3113,7 @@  try_to_simplify (gimple stmt)
      transparently support materializing temporary SSA names
      created by gimple_simplify - or we never value-number
      to them.  */
-  tem = gimple_fold_stmt_to_constant_1 (stmt, vn_valueize);
+  tem = gimple_fold_stmt_to_constant_1 (stmt, vn_valueize, vn_valueize);
   if (tem
       && (TREE_CODE (tem) == SSA_NAME
 	  || is_gimple_min_invariant (tem)))
@@ -3274,6 +3274,7 @@  visit_use (tree use)
 	    {
 	      /* Try constant folding based on our current lattice.  */
 	      tree simplified = gimple_fold_stmt_to_constant_1 (stmt,
+								vn_valueize,
 								vn_valueize);
 	      if (simplified)
 		{