On 8/11/23 03:51, Richard Biener via Gcc-patches wrote:
On Fri, Aug 11, 2023 at 11:17 AM Andrew Pinski via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
So it turns out there was a simplier way of starting to
improve VRP to start to fix PR 110131, PR 108360, and PR 108397.
That was rewrite test_for_singularity to use range_op_handler
and Value_Range.
This patch implements that and
OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
I'm hoping Andrew/Aldy can have a look here.
It's actually pretty simple stuff. Instead of open-coding range
identification for op1 and simplification of that range using op0's
known range (VR), instead we generate a real range for op1 and intersect
that result with the known range for op0. If the result is a singleton,
return it. Simpler and more effective in the end.
I guess the interactions with the warning subsystem are a non-issue in
the updated code since it doesn't return an expression, but the
singleton value (when in the hell did it start returning an expression,
that just seems wrong given the result is supposed to be a singleton!)
LGTM.
Jeff