[PATCH] D115955: [SLP]Alternate vectorization for cmp instructions.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 2 06:21:28 PST 2022


ABataev added a comment.

In D115955#3289277 <https://reviews.llvm.org/D115955#3289277>, @srj wrote:

> In D115955#3289249 <https://reviews.llvm.org/D115955#3289249>, @cmtice wrote:
>
>> We're still working on getting you a reproducible test case, but this is definitely causing some bad codegen for us. Could you please revert it while we work on getting you the test case?
>
> I don't have a reproducible test case yet, but comparing IR before and after the change, I **think** what is happening is that we originally had a comparison like `icmp slt i64 %VALUE, 2147483648`; after this change, this gets combined into a vectorized cmp but (apparently) with the condition reversed: `icmp sgt <4 x i64> %1057, <i64 2147483647, i64 2147483647, i64 2147483647, i64 2147483648>`, where `%VALUE` is in the last slot of the vector, thus giving us effectively a  `sgt` comparison where we should have `slt`.
>
> (Needless to say, this causes amusing failures, with error messages like `Error: Product of extents for buffer is 16384, which exceeds the maximum size of 2147483647`...)
>
> Anyway, I don't think I can narrow this to an easily encapsulated repro case to give you tonight, but in the meantime, perhaps the nature of the apparent failure mode may help track down the issue?

Hi, can you copy-paste a small piece of the transformed code with the vector instructions? +- 10 instructions before and after `icmp sgt <4 x i64> %1057, <i64 2147483647, i64 2147483647, i64 2147483647, i64 2147483648>`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115955/new/

https://reviews.llvm.org/D115955



More information about the llvm-commits mailing list