]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add dbg count support for ccp
authordavidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 28 Mar 2009 20:38:44 +0000 (20:38 +0000)
committerdavidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 28 Mar 2009 20:38:44 +0000 (20:38 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145206 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/dbgcnt.def
gcc/tree-ssa-ccp.c

index ee45bf8336984101c245b241b485bef6a9ed24a5..64d06c0d986abf1418333712e097cde1e46d137e 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-28  Xinliang David Li  <davidxl@google.com>
+
+       * tree-ssa-ccp.c (ccp_finalize): Add dbg_count support. 
+       (do_dbg_cnt): New function.
+
 2009-03-28  Jan Hubicka  <jh@suse.cz>
 
        Merge from pretty-ipa:
index 5330c72680f55c2ba6a67d8551cdf47a26003112..5a2f8f0c505bb6ec2446285ffe35cb1c63d6accf 100644 (file)
@@ -142,6 +142,7 @@ echo ubound: $ub
 
 /* Debug counter definitions.  */
 DEBUG_COUNTER (auto_inc_dec)
+DEBUG_COUNTER (ccp)
 DEBUG_COUNTER (cfg_cleanup)
 DEBUG_COUNTER (cse2_move2add)
 DEBUG_COUNTER (cprop1)
index 26b67224ea6fb2f7ce2133b183271af168dd6f12..c7df588478363149f4519a2f8fc9df7c050d94bc 100644 (file)
@@ -208,6 +208,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "target.h"
 #include "toplev.h"
+#include "dbgcnt.h"
 
 
 /* Possible lattice values.  */
@@ -666,6 +667,24 @@ ccp_initialize (void)
     }
 }
 
+/* Debug count support. Reset the values of ssa names
+   VARYING when the total number ssa names analyzed is
+   beyond the debug count specified.  */
+
+static void
+do_dbg_cnt (void)
+{
+  unsigned i;
+  for (i = 0; i < num_ssa_names; i++)
+    {
+      if (!dbg_cnt (ccp))
+        {
+          const_val[i].lattice_val = VARYING;
+          const_val[i].value = NULL_TREE;
+        }
+    }
+}
+
 
 /* Do final substitution of propagated values, cleanup the flowgraph and
    free allocated storage.  
@@ -675,8 +694,11 @@ ccp_initialize (void)
 static bool
 ccp_finalize (void)
 {
+  bool something_changed;
+
+  do_dbg_cnt ();
   /* Perform substitutions based on the known constant values.  */
-  bool something_changed = substitute_and_fold (const_val, false);
+  something_changed = substitute_and_fold (const_val, false);
 
   free (const_val);
   const_val = NULL;