[COMMITTED] Add transitive operations to the relation oracle.

Andrew MacLeod amacleod@redhat.com
Tue Aug 24 13:45:17 GMT 2021

This patch adds transitive relations to the oracle.

When a relation is registered with the oracle, it searches back thru the 
dominator tree for other relations which may provide a transitive 
relation and registers those. It also considers any active equivalences 
during the search.  With this, we can eliminate this call to kill() in evrp:

   if (a == x && w == z)
      if (x > y)
        if (y > z)
        if (a <= w)
          kill ();

I added a new test case to test various code paths, and I had to adjust 
gcc.dg/predict-1.c to disable evrp because we now eliminate one of the 
branches in the testcase that the prediction engine was looking for data on:

   for (i = 0; i < bound; i++)
       if (i > bound)        // Branch is now eliminated
         global += bar (i);

Bootstraps on x86_64-pc-linux-gnu with no regressions. pushed.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: tran.patch
Type: text/x-patch
Size: 15764 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210824/7234e617/attachment.bin>

More information about the Gcc-patches mailing list