[llvm-bugs] [Bug 31243] New: SLP causes a miscompile
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Dec 2 13:59:39 PST 2016
https://llvm.org/bugs/show_bug.cgi?id=31243
Bug ID: 31243
Summary: SLP causes a miscompile
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Scalar Optimizations
Assignee: unassignedbugs at nondot.org
Reporter: michael.v.zolotukhin at gmail.com
CC: llvm-bugs at lists.llvm.org
Classification: Unclassified
Created attachment 17705
--> https://llvm.org/bugs/attachment.cgi?id=17705&action=edit
Reproducer
Reproducer (slp_bug.ll is attached):
> llc -O0 slp_bug.ll -o good.s
> clang -m32 -o good good.s
> opt -slp-vectorizer slp_bug.ll -o after_slp.ll -S
> llc -O0 after_slp.ll -o bad.s
> clang -m32 -o bad bad.s
> ./good
> echo $?
106
> ./bad
> echo $?
0
The bug is that we sign-extend values, which should be zero-extended instead.
For instance, here:
%10 = zext <4 x i8> %9 to <4 x i32> ; Original value is zero-extended
%11 = trunc <4 x i32> %10 to <4 x i8> ; Now we truncate it...
%12 = extractelement <4 x i8> %11, i32 0 ; extract first element...
%13 = sext i8 %12 to i32 ; and sign-extend it.
...
The issue seems to be introduced in r258929.
--
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/20161202/b322b2c8/attachment.html>
More information about the llvm-bugs
mailing list