[PATCH] D26031: [TargetLowering] Fix undef vector element issue with true/false result handling

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 27 12:02:17 PDT 2016

RKSimon added a comment.

In https://reviews.llvm.org/D26031#581237, @hfinkel wrote:

> My inclination is to leave the code as is, and update the comment to match. If we have all undefs, then we return false (presumably, we have better ways to fold an all-undef operand), but a few undefs are fine.

OK - I'll update the patch to completely ignore the UndefElements arg - its not necessary (getConstantSplatNode returns NULL if its a build vector of all undefs).

> On the other hand, do we generally produce better code if we don't handle undefs at all?

You can see examples of the codegen delta in the patch (the v8i1-masks.ll cases are similar to the real world code that led me to this patch in the first place). The AVX512 vpcmpgtd() -> knotw(vpcmpled()) is a regression, but minimal compared to the gains elsewhere and should be easy to fix later on.



More information about the llvm-commits mailing list