This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.


2014-10-29  Richard Biener  <>

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

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,
 	      if (simplified)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]