[PATCH] D104383: [InstSimplify] propagate poison through FP ops

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 16 07:09:35 PDT 2021


spatel created this revision.
spatel added reviewers: kpn, sepavloff, craig.topper, efriedma, aqjune, nlopes, lebedev.ri.
Herald added subscribers: hiraditya, mcrosier.
spatel requested review of this revision.
Herald added a project: LLVM.

We already have this fold:

  fadd float poison, 1.0 --> poison

...via ConstantFolding, so this makes the behavior consistent if the other operand(s) are non-constant.

The fold for undef was added before poison existed as a value/type in IR.

This came up in D102673 <https://reviews.llvm.org/D102673> / D103169 <https://reviews.llvm.org/D103169> because we're trying to sort out the more complicated handling for constrained math ops. 
We should have the handling for the regular instructions done first, so we can build on that (or diverge as needed).


https://reviews.llvm.org/D104383

Files:
  llvm/lib/Analysis/InstructionSimplify.cpp
  llvm/test/Transforms/InstSimplify/call.ll
  llvm/test/Transforms/InstSimplify/fp-undef-poison.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104383.352428.patch
Type: text/x-patch
Size: 5493 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210616/9a73867a/attachment.bin>


More information about the llvm-commits mailing list