https://gcc.gnu.org/g:36aa66e23cda4ddd4650b64fae66bf1c77435a30

commit r17-4141-g36aa66e23cda4ddd4650b64fae66bf1c77435a30
Author: Aldy Hernandez <[email protected]>
Date:   Wed Sep 9 19:07:58 2026 +0000

    backthreader: dump the per-block insn count again
    
    Now that the dust has settled, dump the per-block insn account.
    
    Tested on ppc64le Linux.
    
    gcc/ChangeLog:
    
            * tree-ssa-threadbackward.cc (back_threader_profitability):
            Remove the note on bb_insns.
            (back_threader_profitability::possibly_profitable_path_p): Dump
            each block's insn count.

Diff:
---
 gcc/tree-ssa-threadbackward.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-ssa-threadbackward.cc b/gcc/tree-ssa-threadbackward.cc
index 2493f134f87b..99e88e5e8f34 100644
--- a/gcc/tree-ssa-threadbackward.cc
+++ b/gcc/tree-ssa-threadbackward.cc
@@ -93,7 +93,6 @@ private:
   struct unwind_state
   {
     path_stats stats;
-    // Unused here; read by the per-block insn dump later in this series.
     int bb_insns;
   };
   auto_vec<unwind_state, 20> m_unwind;
@@ -757,6 +756,10 @@ back_threader_profitability::possibly_profitable_path_p
       for (unsigned j = 0; j < m_path.length (); j++)
        {
          fprintf (dump_file, " bb:%i", m_path[j]->index);
+         /* The last block on the path is not copied, so it has no
+            count of its own.  */
+         if (j + 1 < m_path.length ())
+           fprintf (dump_file, " (%i insns)", m_unwind[j + 1].bb_insns);
          if (loop->latch == m_path[j])
            fprintf (dump_file, " (latch)");
        }

Reply via email to