Issue 127177
Summary [SLPVectorizer] Miscompilation at O2
Labels miscompilation, llvm:SLPVectorizer, generated by fuzzer
Assignees
Reporter dtcxzyw
    Reproducer: 
```
; bin/opt -passes=slp-vectorizer test.ll -S
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

define i8 @test() {
entry:
 %inc.1.i.i = zext i1 false to i8
  %inc.2.i.i = zext i1 false to i8
 %inc.3.i.i = zext i1 false to i8
  %inc.6.i.i = zext i1 false to i8
 %inc.7.i.i = zext i1 false to i8
  %inc.8.i.i = zext i1 false to i8
 %inc.10.i.i = zext i1 false to i8
  %inc.11.i.i = zext i1 false to i8
 %inc.12.i.i = zext i1 true to i8
  %inc.13.i.i = zext i1 false to i8
 %inc.14.i.i = zext i1 false to i8
  %inc.15.i.i = zext i1 false to i8
 %inc9.1.i.i = add i8 %inc.2.i.i, %inc.1.i.i
  %inc9.2.i.i = add i8 %inc9.1.i.i, %inc.3.i.i
  %spec.select17.i.i = add i8 %inc9.2.i.i, %inc.6.i.i
  %spec.select18.i.i = add i8 %spec.select17.i.i, %inc.7.i.i
 %spec.select19.i.i = add i8 %spec.select18.i.i, %inc.8.i.i
 %spec.select21.i.i = add i8 %spec.select19.i.i, %inc.10.i.i
 %spec.select22.i.i = add i8 %spec.select21.i.i, %inc.11.i.i
 %spec.select23.i.i = add i8 %spec.select22.i.i, %inc.12.i.i
 %spec.select24.i.i = add i8 %spec.select23.i.i, %inc.13.i.i
 %spec.select25.i.i = add i8 %spec.select24.i.i, %inc.14.i.i
 %spec.select26.i.i = add i8 %spec.select25.i.i, %inc.15.i.i
  ret i8 %spec.select26.i.i
}
```
Output:
```
define i8 @test() {
entry:
  %0 = call i12 @llvm.ctpop.i12(i12 0)
  %1 = trunc i12 %0 to i8
  ret i8 %1
}
```
The correct return value is 1.

llvm version: 8a0914c24530c98c5ff65bce3710552ce3ebf7d7
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to