[llvm-dev] how to simplify FP ops with an undef operand?

Sanjay Patel via llvm-dev llvm-dev at lists.llvm.org
Tue Feb 27 18:29:03 PST 2018

%y = fadd float %x, undef

Can we simplify this?

Currently in IR, we do nothing for fadd/fsub/fmul. For fdiv/frem, we
propagate undef. The code comment for fdiv/frem says:
"the undef could be a snan"

If that's correct, then shouldn't it be the same for fadd/fsub/fmul? But
this can't be correct because we support targets that don't raise
exceptions...and even targets that raise exceptions do not trap by default
on snan?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180227/a5c4d756/attachment.html>

More information about the llvm-dev mailing list