[llvm-bugs] [Bug 44306] New: InstCombine incorrectly shrinks the size of store

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Dec 15 09:40:19 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=44306

            Bug ID: 44306
           Summary: InstCombine incorrectly shrinks the size of store
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: juneyoung.lee at sf.snu.ac.kr
                CC: llvm-bugs at lists.llvm.org

Created attachment 22938
  --> https://bugs.llvm.org/attachment.cgi?id=22938&action=edit
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191215/5b77e06e/attachment.html>


More information about the llvm-bugs mailing list