Abstract out conditional simplification out of execute_vrp.
authorAldy Hernandez <aldyh@redhat.com>
Mon, 26 Jul 2021 09:53:41 +0000 (11:53 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Mon, 26 Jul 2021 11:40:15 +0000 (13:40 +0200)
commit32f7506bdc3956762bcc7dc84133fd7c3a00bb7b
tree8440f5a2f5a13c70852c862b807138b8bbb1b6c3
parentdd44445f09bcf92198e9238a28bf026959152be1
Abstract out conditional simplification out of execute_vrp.

VRP simplifies conditionals involving casted values outside of the main
folding mechanism, because this optimization inhibits the VRP jump
threader from threading through the comparison.

As part of replacing VRP with an evrp instance, I am making sure we do
everything VRP does.  Hence, I am abstracting this functionality out so
we can call it from from elsewhere.

ISTM that when the proposed ranger-based jump threader can handle
everything the forward threader does, there will be no need for this
optimization to be done outside of the evrp folder.  Perhaps we can fold
this into the substitute_using_ranges class.  But that's further down
the line.

Also, there is no need to pass a vr_values around, when the base
range_query class will do.  I fixed this, at it makes it trivial to pass
down a ranger or evrp instance.

Tested on x86-64 Linux.

gcc/ChangeLog:

* tree-vrp.c (vrp_simplify_cond_using_ranges): Rename vr_values
with range_query.
(execute_vrp): Abstract out simplification of conditionals...
(simplify_casted_conds): ...here.
gcc/tree-vrp.c