[PATCH] D98410: [ConstantFold] Handle undef/poison when constant folding smul_fix/smul_fix_sat

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 11 04:44:57 PST 2021


bjope added a comment.

In D98410#2619250 <https://reviews.llvm.org/D98410#2619250>, @nagisa wrote:

> Wouldn't folding `C * undef` and `undef * C` into an `undef`, rather than `0`, be valid/better? Is there a reason we cannot do that?

I figure that it would be wrong if for example C is zero, because then the result can't take any other value than zero. Or if C is 2 and scale is 0, then the result can't be odd. So undef include values that isn't possible for every combination of the other operands.

The poison propagation is a bit more new for me. I hope I got that part correct.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98410



More information about the llvm-commits mailing list