https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126904
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Aldy Hernandez <[email protected]>: https://gcc.gnu.org/g:59e5dcee5375614cf1cc58e97dcc04f63bc9b519 commit r17-5022-g59e5dcee5375614cf1cc58e97dcc04f63bc9b519 Author: Aldy Hernandez <[email protected]> Date: Fri Oct 9 09:46:01 2026 +0000 sccvn: add a driver object for the value numbering walk [PR126904] SCC VN is driven through various free functions (do_rpo_vn_1 walks, run_rpo_vn, etc). Encapsulate this into vn_driver, so we can later implement jump threading from within FRE, where the value numbers have to outlive the walk. The general plan is: class path_vn : public vn_driver { public: bool reset_path (const vec<basic_block> &path); void clear_path (); tree valnum (tree name); }; // And then in FRE path_vn vn (fun, iterate_p, !iterate_p); threader.search (vn); todo = vn.finalize (); todo |= threader.apply (); No functional change: the assembly is identical over a corpus of .ii files from a stage1 bootstrap. Tested on ppc64le Linux. PR tree-optimization/126904 gcc/ChangeLog: * tree-ssa-sccvn.h (class vn_driver): New. (run_rpo_vn, eliminate_with_rpo_vn, free_rpo_vn): Remove. * tree-ssa-sccvn.cc (class eliminate_dom_walker): Make the destructor virtual. (eliminate_with_rpo_vn): Make static. (run_rpo_vn): Rename to ... (assign_value_ids): ... this, static and without the walk. (free_rpo_vn): Make static. (do_rpo_vn_1): Take the walker and the RPO map from the caller. (vn_driver::vn_driver, vn_driver::~vn_driver) (vn_driver::finalize): New. (do_rpo_vn, pass_fre::execute): Use a vn_driver. * tree-ssa-pre.cc (pass_pre::execute): Same.
