<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 - Incorrect optimization in InstSimplify"
   href="https://bugs.llvm.org/show_bug.cgi?id=39510">39510</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incorrect optimization in InstSimplify
          </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>Linux
          </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>Transformation Utilities
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>sbc@chromium.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following C code is (I believe) incorrectly being reduces to a constant
value:

```
int f (int a) {
  a = a > 0 ? a : -a;
  if (a == 2)
    return 0;
  else
    return 1;
}
```

$ clang vrp-2.c -O1 -c -emit-llvm -S  -o -
...

define dso_local i32 @f(i32 %a) local_unnamed_addr #0 {
entry:
  ret i32 1
}
...

I tracked it down to this recent change:
<a href="https://reviews.llvm.org/D53844">https://reviews.llvm.org/D53844</a></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>