[PATCH] D48893: [Constants, InstCombine] allow RHS (operand 1) identity constants for binops

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 3 15:09:50 PDT 2018


spatel added subscribers: aqjune, sanjoy, nlopes.
spatel added a comment.

In https://reviews.llvm.org/D48893#1151303, @lebedev.ri wrote:

> I don't think this is wrong, but does this propagation of `undef` not make the new versions more poisonous?


That's a good question. My understanding is that no, there is no more poison here than before because in the original code the shuffle's undef mask element means that lane of the vector is undef, so nothing downstream that might be using that lane can be valid. After this transform, we're performing some binop with an undef operand, so again the result of that lane is undef, and nothing downstream can be any different.

This is ok for everything except integer div/rem because they're the only ops with immediate UB. cc'ing @nlopes @sanjoy @aqjune to see if that reasoning is bogus.


https://reviews.llvm.org/D48893





More information about the llvm-commits mailing list