[PATCH] D106053: [CodeGen] Remove pending AssertZext AssertSext in promoting FP_TO_INT

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 16 18:26:50 PDT 2021


efriedma added a comment.

> +  After appending AssertZext, the shuffle optimization will stop zero these elements, and directly use them.   That is wrong.

I agree up to this point.

The question is, is the AssertZext node wrong, or are the shuffle optimizations wrong?  That dictates whether we go with this patch, or instead revert 2a419a0b9957 <https://reviews.llvm.org/rG2a419a0b9957ebac9e11e4b43bc9fbe42a9207df> (and any similar optimizations, if they exist).

----

In any case, we should probably add the following example as a regression test:

  define <16 x i8> @src(<4 x float> %arg1) {
    %f = fptoui <4 x float> %arg1 to <4 x i8>
    %s = shufflevector <4 x i8> %f, <4 x i8> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
    %ss = shufflevector <16 x i8> %s, <16 x i8> zeroinitializer, <16 x i32> <i32 0, i32 17, i32 18, i32 19, i32 1, i32 21, i32 22, i32 23, i32 2, i32 25, i32 26, i32 27, i32 3, i32 29, i32 30, i32 31>
    ret <16 x i8> %ss
  }


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

https://reviews.llvm.org/D106053



More information about the llvm-commits mailing list