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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 12:25:18 PST 2019


spatel added a comment.

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

> BTW, does the current semantics of shufflevector imply that
>
>   %shuf = shufflevector <4 x float> %arg, <4 x float> undef, <4 x i32> <i32 undef, i32 1, i32 2, i32 3>
>   ->
>   %shuf = shufflevector <4 x float> %arg, <4 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
>
>
> is incorrect?


AFAIK, no - but that's because we were using 'undef' in the docs here:
http://llvm.org/docs/LangRef.html#shufflevector-instruction
(no mention of poison)

> If the reason why shufflevector returns undef is simply there was no poison constant, why don't we move toward adding poison constant?

What steps are needed to make it happen? From the discussion in PR43958, it sounds like adding+using the new constant might take a while? If not, and we can avoid/alter this patch, that would be better for me (no risk of losing optimizations).


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

https://reviews.llvm.org/D70246





More information about the llvm-commits mailing list