[PATCH] D93617: [LoopVectorize] Take argument's size into consideration when computing leader's demanded bits

guopeilin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 29 02:53:03 PST 2020


guopeilin added a comment.

In D93617#2471528 <https://reviews.llvm.org/D93617#2471528>, @nikic wrote:

> This causes a number of test failures:
>
>   Failed Tests (4):
>     LLVM :: Transforms/LoopVectorize/AArch64/deterministic-type-shrinkage.ll
>     LLVM :: Transforms/LoopVectorize/AArch64/loop-vectorization-factors.ll
>     LLVM :: Transforms/LoopVectorize/ARM/tail-folding-reduces-vf.ll
>     LLVM :: Transforms/LoopVectorize/demanded-bits-of-pointer-instruction.ll
>
> Last one is an assertion failure because you assume non-pointer types, the others are presumably optimization regressions. What you are effectively doing here is to disable the truncation optimization completely for any case where the instruction chain contains an argument or a constant somewhere. Especially the latter case is probably very common. So while this change does fix the miscompile, it effectively disables the optimization entirely, which is probably not desired.

A new patch updated, this patch adds constraints that we only visit argument when traversing all non-instruction values and take care of the case that `BiseSize == 0`. This patch passes all my cases and the cases you mentioned.


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

https://reviews.llvm.org/D93617



More information about the llvm-commits mailing list