[PATCH] D33863: [DAGComine] (fadd x, undef) -> undef and (fmul x, undef) -> undef

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 12:10:35 PDT 2017


efriedma added a subscriber: nlopes.
efriedma added a comment.

fadd NaN, undef -> undef isn't legal: any fadd involving NaN always produces a NaN.  Similar reasoning applies to most other floating-point values.

fadd %x, undef -> NaN is legal because fadd %x, NaN -> NaN is legal.  I don't think we do this transform at the moment when %x isn't a constant, but this is consistent with the behavior of APFloat.

This is probably an argument in favor of getting rid of undef. :)


https://reviews.llvm.org/D33863





More information about the llvm-commits mailing list