On 10/4/26 10:51 AM, Aldy Hernandez wrote:
DOM is using its simplify_binary_operation method to derive things
that ranger can do better.  Remove the function and let ranger do its
thing.

I added some functionality tests to make sure we don't mysteriously
stop handling cases simplify_binary_operation did.  Although that's
unlikely as ranger is pretty mature by now, and surely a regression
would pop up ;-).

Tested on ppc64le Linux.

OK for trunk?

gcc/ChangeLog:

        * tree-ssa-dom.cc (dom_opt_dom_walker::const_or_copy_of_stmt): New.
        (dom_opt_dom_walker::eliminate_redundant_computations): Ask it on
        a lookup miss.
        * tree-ssa-scopedtables.cc (simplify_binary_operation): Remove.
        (lookup_avail_expr): Do not call it.
        * tree-ssa-scopedtables.h (simplify_binary_operation): Remove.

gcc/testsuite/ChangeLog:

        * gcc.dg/tree-ssa/ssa-dom-simplify-2.c: New test.
I have vague recollections of one or more of the bogus warning bugs in BZ being solveable by extending simplify_binary_operation, so I wouldn't be terribly surprised if we were to pass through them after this work to see one or two of them improve.  I don't think it's necessary to do that now, the most important ones (regressions) will be naturally revisited during stage3/stage4.

OK
jeff

Reply via email to