[PATCH] D124158: [Clang][Attr] Skip adding noundef attribute to arguments when function has convergent attribute

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 2 10:39:34 PDT 2022


jdoerfert added a comment.

In D124158#3480566 <https://reviews.llvm.org/D124158#3480566>, @efriedma wrote:

> In D124158#3480384 <https://reviews.llvm.org/D124158#3480384>, @arsenm wrote:
>
>> I'm thinking noundef is a bit of red herring here. The real problem seems to be arising from the assume call which is inserted, which now introduces the assumption that the lane ID must be 0
>
> The optimizer is creating the llvm.assume call based on the violation of the noundef attribute.

I agree. As far as I can tell you have two options, both are specific to the shuffle functions:

1. Do not set noundef for calls to them as they allow undef values for all lanes we don't read the value.
2. Freeze the inputs unconditionally.

Convergent is unrelated to this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124158



More information about the llvm-commits mailing list