llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.28k stars 12.1k forks source link

Wrong result for _BitInt bitwise & testcase #114360

Open mikaelholmen opened 3 weeks ago

mikaelholmen commented 3 weeks ago

llvm commit: 6effab990c5c1b Reproducer:

clang bbi-100697.c -O2 -std=c23
./a.out

Result:

Fail!

This starts happening with https://github.com/llvm/llvm-project/commit/1833d418a04123916c1dbeb0c41c8bc7d06b779b Before that commit we got

Pass!

which is the expected result.

I originally reported this in https://github.com/llvm/llvm-project/pull/107461#issuecomment-2446969736 but @alexey-bataev did some analysis in https://github.com/llvm/llvm-project/pull/107461#issuecomment-2448053507 suggesting that the error is somewhere in X86 Codegen rather than in SLP vectorizer.

As I wrote in the original report the input was originally part of a much larger test so I've reduced it a lot but unfortunately it's still quite large (and ugly).

bbi-100697.c.gz

mikaelholmen commented 3 weeks ago

Slightly reduced C input in bbi-100697_2.c but it's still not very nice.

bbi-100697_2.c.gz

llvmbot commented 3 weeks ago

@llvm/issue-subscribers-backend-x86

Author: Mikael Holmén (mikaelholmen)

llvm commit: 6effab990c5c1b Reproducer: ``` clang bbi-100697.c -O2 -std=c23 ./a.out ``` Result: ``` Fail! ``` This starts happening with https://github.com/llvm/llvm-project/commit/1833d418a04123916c1dbeb0c41c8bc7d06b779b Before that commit we got ``` Pass! ``` which is the expected result. I originally reported this in https://github.com/llvm/llvm-project/pull/107461#issuecomment-2446969736 but @alexey-bataev did some analysis in https://github.com/llvm/llvm-project/pull/107461#issuecomment-2448053507 suggesting that the error is somewhere in X86 Codegen rather than in SLP vectorizer. As I wrote in the original report the input was originally part of a much larger test so I've reduced it a lot but unfortunately it's still quite large (and ugly). [bbi-100697.c.gz](https://github.com/user-attachments/files/17582314/bbi-100697.c.gz)
llvmbot commented 3 weeks ago

@llvm/issue-subscribers-bug

Author: Mikael Holmén (mikaelholmen)

llvm commit: 6effab990c5c1b Reproducer: ``` clang bbi-100697.c -O2 -std=c23 ./a.out ``` Result: ``` Fail! ``` This starts happening with https://github.com/llvm/llvm-project/commit/1833d418a04123916c1dbeb0c41c8bc7d06b779b Before that commit we got ``` Pass! ``` which is the expected result. I originally reported this in https://github.com/llvm/llvm-project/pull/107461#issuecomment-2446969736 but @alexey-bataev did some analysis in https://github.com/llvm/llvm-project/pull/107461#issuecomment-2448053507 suggesting that the error is somewhere in X86 Codegen rather than in SLP vectorizer. As I wrote in the original report the input was originally part of a much larger test so I've reduced it a lot but unfortunately it's still quite large (and ugly). [bbi-100697.c.gz](https://github.com/user-attachments/files/17582314/bbi-100697.c.gz)
mikaelholmen commented 3 weeks ago

Slightly more reduced C input in bbi-100697_3.c and somewhat cleaned up so it's a bit easier to understand what the C code is actually testing. I really have troubles getting further than this though.

bbi-100697_3.c.gz