<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - NewGVN: Missed value inference that paper algorithm would get"
   href="https://bugs.llvm.org/show_bug.cgi?id=34531">34531</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>NewGVN: Missed value inference that paper algorithm would get
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Scalar Optimizations
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dberlin@dberlin.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>davide@freebsd.org, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Just to write this down somewhere:

The value inference algorithm (which we use predicateinfo in part to replace)
in the paper is quite powerful.

It will catch things we do not.

In particular two types of cases (and all their variants), one easy, one hard:

c = a != b
if (a == b) {
     use c
}

This we have a straightforward way of fixing.
We can fix it either in NewGVN, *or* in PredicateInfo

Here is one that is harder:

I = J + 0
if (J == 0) {
    K = I // Or I + something if you like
    use K;
}

Here, K is 0
The value inferencing algorithm knows that J is congruent to I, so that the
predicates that apply to J apply to I.
PredicateInfo does not.


Here is one that is even harder:

I = J + 2
if (J == 0) {
    K = I // Or I + something if you like
    use K;
}


Now, i believe actually that we can do something useful here.


I believe i can solve all of these through making predicateinfo a congruence
class thing instead of a per-variable thing.
(It applies to anything that is equivalent to a predicate, otherwise, they
could not be equivalent)
It would also help to be able to add predicateinfo uses as we go.

Currently we can't because it's an analysis.
I may turn it back into a virtual form (I think i can make it work now that
i've thought about it more) so we can do that.

I will probably start by making predicateinfo per-congruence class.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>