[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
Sat Jul 17 13:42:14 PDT 2021


efriedma added a comment.

The one-line summary: if computeKnownBits says a bit is "known", it means either the bit has that value, or that lane of the vector is poisoned.

For almost all optimizations, the possibility of poison doesn't matter: if the source lane is poison, the result lane is also poison.  However, this means the 2a419a0b <https://reviews.llvm.org/rG2a419a0b9957ebac9e11e4b43bc9fbe42a9207df> transform isn't safe: if a lane in the result of a shufflevector is supposed to be zero, it has to actually be zero, not zero-or-poison.  We could recover the optimization for the cases where it's legal with some form of isGuaranteedNotToBePoison().

Some other shuffle transforms might also run into trouble with poison?  For example, matchShuffleWithPACK is wrong, I think, but the problem isn't the use of MaskedValueIsZero.  The issue is the use of getBitcast(): if you bitcast from `<4 x i8>` to `<1 x i32>`, the 32-bit lane is poison if any of the input i8 lanes are poison.


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

https://reviews.llvm.org/D106053



More information about the llvm-commits mailing list