[llvm] [SLP]Improve minbitwidth analysis for shifts. (PR #84356)
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 26 09:46:08 PDT 2024
alexey-bataev wrote:
> Hi @alexey-bataev ,
>
> I think we get a miscompile with this patch Reproduce with:
>
> ```
> opt bbi-93743_2.ll -mtriple=aarch64 -passes=slp-vectorizer -S -o - -slp-threshold=-100
> ```
>
> The problem occurs if both inputs to foo are 0xffffffffffffffff.
>
> Then the
>
> ```
> %5 = shufflevector <2 x i128> %3, <2 x i128> %4, <2 x i32> <i32 0, i32 3>
> ```
>
> in the slp-vectorizer output will result in
>
> ```
> <0x10000000000000000,poison>
> ```
>
> due to the "nsw" on the "shl", and that poison then turns the return value from the function to be poison as well.
>
> [bbi-93743_2.ll.gz](https://github.com/llvm/llvm-project/files/14756140/bbi-93743_2.ll.gz)
Ok, it is not an issue of this patch, but a long-standing issue in vectorizer. I haму a fix got this in one of the extra patches, will commit it separately with your reproducer.
https://github.com/llvm/llvm-project/pull/84356
More information about the llvm-commits
mailing list