<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - Very recent regression when optimizing i128"
   href="https://llvm.org/bugs/show_bug.cgi?id=27792">27792</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Very recent regression when optimizing i128
          </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>normal
          </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>yyc1992@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>According to our (julia) buildbot, this happened within the last 24 hours

<a href="http://buildbot.e.ip.saba.us:8010/builders/nightly_llvmsvn-x64">http://buildbot.e.ip.saba.us:8010/builders/nightly_llvmsvn-x64</a>
<a href="http://buildbot.e.ip.saba.us:8010/builders/nightly_llvmsvn-x86">http://buildbot.e.ip.saba.us:8010/builders/nightly_llvmsvn-x86</a>

So far all of the failing tests seems to be related to 128bit integer handling.
It is unclear if there is a single issue but one of the reduced test case is
(this is the code we emit for sign check)

```
define i32 @f(i128) {
top:
  %1 = lshr i128 %0, 127
  %2 = trunc i128 %1 to i1
  %3 = xor i1 %2, true
  br i1 %3, label %pass, label %fail

fail:                                             ; preds = %top
  ret i32 0

pass:                                             ; preds = %top
  ret i32 1
}
```

For -O1 to -O3 with opt on x64, this is mis-optimized to

```
yuyichao% usr/bin/opt -O3 -S -o - a.ll
; ModuleID = 'a.ll'
source_filename = "a.ll"

; Function Attrs: norecurse nounwind readnone
define i32 @f(i128) #0 {
top:
  %1 = icmp sgt i128 %0, 18446744073709551615
  %. = zext i1 %1 to i32
  ret i32 %.
}

attributes #0 = { norecurse nounwind readnone }
```

Where `18446744073709551615` is the 64 bits representation of `-1`. The code is
correct if it is an 128 bits `-1` (which is what LLVM 3.8 optimized it to in a
similar case (not for this case))</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>