[PATCH] D70246: [InstCombine] remove identity shuffle simplification for mask with undefs

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 15 06:22:23 PST 2019


spatel added a comment.

In D70246#1746898 <https://reviews.llvm.org/D70246#1746898>, @aqjune wrote:

> If `%arg[0] = poison`, it seems the current semantics (returning undef when the shuffle mask is undef) cannot explain the transformation.
>
>   %shuf = shufflevector <4 x float> %arg, <4 x float> undef, <4 x i32> <i32 undef, i32 1, i32 2, i32 3>
>
>
> %shuf[0] is undef, but after transformation,
>
>   %shuf = shufflevector <4 x float> %arg, <4 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
>
>
> %shuf[0] is poison.


This is correct based on my understanding of poison (and what we've implemented so far), but we do not explicitly state that poison can occur per-element of a vector. Should we add a LangRef edit here or in a separate patch to address that?


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

https://reviews.llvm.org/D70246





More information about the llvm-commits mailing list