Andrew Pinski wrote:

> Did you look into where this was showing up?
> 
No.  Happens on libjava/interpret.cc.  Here's the patch I used and the
stats collecting script, if you're interested in gathering more info.
Index: tree-into-ssa.c
===================================================================
--- tree-into-ssa.c	(revision 111136)
+++ tree-into-ssa.c	(working copy)
@@ -1773,6 +1773,29 @@ rewrite_into_ssa (void)
   free (dfs);
   sbitmap_free (interesting_blocks);
 
+  FOR_EACH_BB (bb)
+    {
+      block_stmt_iterator si;
+
+      for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+	{
+	  enum tree_code code;
+	  int i;
+	  tree stmt = bsi_stmt (si);
+
+	  code = TREE_CODE (stmt);
+	  fprintf (stderr, "STMT: %-12s", tree_code_name[code]);
+	  for (i = 0; i < TREE_CODE_LENGTH (code); i++)
+	    {
+	      tree op = TREE_OPERAND (stmt, i);
+	      if (op)
+		fprintf (stderr, " OP%d: %-12s", i,
+		         tree_code_name[TREE_CODE (op)]);
+	    }
+	  fprintf (stderr, " (%d OPS)\n", i - 1);
+	}
+    }
+
   timevar_pop (TV_TREE_SSA_OTHER);
   in_ssa_p = true;
 }
#!/bin/sh
data=00all-gimple-stmts
stmts=00stmt-codes
ops=00op-codes
total_stmts=`cat $data | wc -l`

echo "GIMPLE statement codes ($total_stmts statements)"
echo
for f in `cat $stmts` ; do
    cnt=`grep "STMT: $f" $data | wc -l`
    printf "%-15s = %9d (%3d%%)\n" $f $cnt $[ $cnt * 100 / $total_stmts ]
done

echo
echo
echo "Number of operands per statement"
echo
total_ops=0
for f in 0 1 2 3 4 ; do
    cnt=`grep "$f OPS" $data | wc -l`
    printf "%d operand(s): %9d (%3d%%)\n" $[ $f + 1 ] $cnt $[ $cnt * 100 / 
$total_stmts ]
    total_ops=$[ $total_ops + ($f + 1) * $cnt ]
done

echo
echo
echo "Operands used ($total_ops operands)"
echo
for f in `cat $ops` ; do
    cnt=`grep -o "OP.: $f" $data | wc -l`
    printf "%-15s = %9d (%3d%%)\n" $f $cnt $[ $cnt * 100 / $total_ops ]
done

Reply via email to