[PATCH] D70093: [InstCombine] Avoid moving ops that do restrict undef across shuffles.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 13 02:04:39 PST 2019


fhahn marked 2 inline comments as done.
fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:1568
       //       for target-independent shuffle creation.
       if (I >= SrcVecNumElts) {
         Constant *MaybeUndef =
----------------
spatel wrote:
> What if we extend this check instead:
>       if (I >= SrcVecNumElts || ShMask[I] < 0) {
> 
> Currently, we're transferring an undef element from the original shuffle to the newly created shuffle, but that's not safe in general. It is safe, however, if the binop would constant fold to undef given an undef operand.
> 
> (Sorry this code got so complicated...)
That's indeed a better place. I've updated the code to use the existing checks here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70093





More information about the llvm-commits mailing list