[PATCH] D44521: [InstSimplify] fp_binop X, NaN --> NaN

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 16 14:10:50 PDT 2018


spatel updated this revision to Diff 138765.
spatel added a comment.

Patch updated:
Propagate the existing NaN constant. We don't try to quiet a signaling NaN. The only case where we would not return the existing constant is a vector with undef elements (in that case just return a default NaN).

This patch doesn't deal with cases where both operands are NaN. That's handled by constant folding. Evidence of that behavior is provided by the fneg tests in the test file (nothing changing here).

The AMDGPU tests now show the expected constant values (but I'm still not sure exactly what was intended in those tests).


https://reviews.llvm.org/D44521

Files:
  lib/Analysis/InstructionSimplify.cpp
  test/CodeGen/AMDGPU/imm.ll
  test/CodeGen/AMDGPU/imm16.ll
  test/CodeGen/AMDGPU/immv216.ll
  test/CodeGen/AMDGPU/jump-address.ll
  test/Transforms/InstSimplify/fp-nan.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44521.138765.patch
Type: text/x-patch
Size: 17639 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180316/aa63301c/attachment.bin>


More information about the llvm-commits mailing list