https://gcc.gnu.org/g:5b3ba4d1832dd5b5879f98ae938a35fcb63110ff
commit r17-4981-g5b3ba4d1832dd5b5879f98ae938a35fcb63110ff Author: Aldy Hernandez <[email protected]> Date: Fri Oct 2 13:17:59 2026 +0000 sccvn: split recording the unwind state out of do_rpo_vn_1 do_unwind unwinds the tables to a state do_rpo_vn_1 records inline. Split the recording out, so that a later patch can record the same state. Tested on ppc64le Linux. gcc/ChangeLog: * tree-ssa-sccvn.cc (record_unwind_state): New, split out of... (do_rpo_vn_1): ...here. Diff: --- gcc/tree-ssa-sccvn.cc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc index 03bf9a0ec4d9..7ff14cec119a 100644 --- a/gcc/tree-ssa-sccvn.cc +++ b/gcc/tree-ssa-sccvn.cc @@ -8819,6 +8819,18 @@ struct unwind_state vn_avail *avail_top; }; +/* Record in TO the RPO VN state do_unwind unwinds to. */ + +static void +record_unwind_state (unwind_state *to) +{ + to->ob_top = obstack_alloc (&vn_tables_obstack, 0); + to->ref_top = last_inserted_ref; + to->phi_top = last_inserted_phi; + to->nary_top = last_inserted_nary; + to->avail_top = last_pushed_avail ? last_pushed_avail->avail : NULL; +} + /* Unwind the RPO VN state for iteration. */ static void @@ -9070,14 +9082,7 @@ do_rpo_vn_1 (function *fn, edge entry, bitmap exit_bbs, not iterate where we then handle PHIs conservatively. We do that heuristically to reduce compile-time for degenerate cases. */ if (rpo_state[idx].iterate) - { - rpo_state[idx].ob_top = obstack_alloc (&vn_tables_obstack, 0); - rpo_state[idx].ref_top = last_inserted_ref; - rpo_state[idx].phi_top = last_inserted_phi; - rpo_state[idx].nary_top = last_inserted_nary; - rpo_state[idx].avail_top - = last_pushed_avail ? last_pushed_avail->avail : NULL; - } + record_unwind_state (&rpo_state[idx]); if (!(bb->flags & BB_EXECUTABLE)) {
