[LLVMbugs] [Bug 23635] New: Instcombine wrongly preserves mul nsw
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri May 22 03:40:41 PDT 2015
https://llvm.org/bugs/show_bug.cgi?id=23635
Bug ID: 23635
Summary: Instcombine wrongly preserves mul nsw
Product: libraries
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Scalar Optimizations
Assignee: unassignedbugs at nondot.org
Reporter: nunoplopes at sapo.pt
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
$ cat a.ll
define i2 @func34669005(i2, i1, i4, i2, i1, i4, i2, i1, i4, i2, i1, i4) {
%13 = mul nsw i2 %0, %3
%14 = mul nsw i2 %6, %0
%15 = sub nuw nsw i2 %13, %14
ret i2 %15
}
$ opt.exe -instcombine -S a.ll
define i2 @func34669005(i2, i1, i4, i2, i1, i4, i2, i1, i4, i2, i1, i4) {
%13 = sub i2 %3, %6
%14 = mul nsw i2 %13, %0
ret i2 %14
}
$ ./alive.py a.opt
----------------------------------------
%13 = mul nsw i2 %0, %3
%14 = mul nsw i2 %6, %0
%15 = sub nuw nsw i2 %13, %14
ret i2 %15
=>
%p13 = sub i2 %3, %6
%p14 = mul nsw i2 %p13, %0
ret i2 %p14
ERROR: Domain of poisoness of Target is smaller than Source's for i2 ret_
Example:
%0 i2 = 0x3 (3, -1)
%3 i2 = 0x1 (1)
%6 i2 = 0x3 (3, -1)
%13 i2 = 0x3 (3, -1)
%14 i2 = 0x1 (1)
%15 i2 = 0x2 (2, -2)
%p13 i2 = 0x2 (2, -2)
%p14 i2 = 0x2 (2, -2)
Source value: 0x2 (2, -2)
Target value: poison
--
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/20150522/7c75511f/attachment.html>
More information about the llvm-bugs
mailing list