[PATCH] D38637: [InstSimplify] don't let poison inhibit an easy fold

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 6 13:09:22 PDT 2017


spatel added a comment.

Also, this is in the header comment for computeKnownBits():
/// NOTE: we cannot consider 'undef' to be "IsZero" here.  The problem is that
/// we cannot optimize based on the assumption that it is zero without changing
/// it to be an explicit zero.  If we don't change it to zero, other code could
/// optimized based on the contradictory assumption that it is non-zero.

So since we don't know what the caller will do with the result, we're conservative. Is it different if something is known to produce poison rather than undef?


https://reviews.llvm.org/D38637





More information about the llvm-commits mailing list