On Wed, 4 Nov 2015, Richard Biener wrote:

The following patch makes sure that CCP when it computes a lattice
value to UNDEFINED ends up replacing uses with default defs (and thus
removes such UNDEFINED producing defs).  This optimizes the testcase
below to

 <bb 2>:
 return _6(D);

in the first CCP.  Note this patch isn't mainly for the optimization
it does but for making it easier to discover cases where CCP gets
UNDEFINED wrong (similar to VRP2 re-using the range-info that is
still live on SSA names - that's to catch bogus range-info).

If the experiment works out (read: bootstrap / test completes
successfully) I'm going to enhance VRP and will also look at
how value-numbering could do a similar job.

Cool, the VN part might help with https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01556.html
:-)

It might also help removing unreachable (undefined) code earlier
of course.

--
Marc Glisse

Reply via email to