<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 - InstCombine incorrectly shrinks the size of store"
   href="https://bugs.llvm.org/show_bug.cgi?id=44306">44306</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>InstCombine incorrectly shrinks the size of store
          </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>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>juneyoung.lee@sf.snu.ac.kr
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=22938" name="attach_22938" title="input.ll">attachment 22938</a> <a href="attachment.cgi?id=22938&action=edit" title="input.ll">[details]</a></span>
input.ll

```
$ cat input.ll
define void @PR37526(i32* %pz, i32* %px, i32* %py) {
  %t2 = load i32, i32* %py
  %t3 = load i32, i32* %px
  %cmp = icmp slt i32 %t2, %t3
  %select = select i1 %cmp, i32* %px, i32* %py
  %bc = bitcast i32* %select to i64*
  %r = load i64, i64* %bc
  %t1 = bitcast i32* %pz to i64*
  store i64 %r, i64* %t1
  ret void
}

$ opt -instcombine -S -o - input.ll
define void @PR37526(i32* %pz, i32* %px, i32* %py) {
  %t2 = load i32, i32* %py, align 4
  %t3 = load i32, i32* %px, align 4
  %cmp = icmp slt i32 %t2, %t3
  %r1 = select i1 %cmp, i32 %t3, i32 %t2
  store i32 %r1, i32* %pz, align 4
  ret void
}
```

After InstCombine, the i64 store in source is shrinked into i32 store, which is
incorrect.</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>