OSDN Git Service

[DAG] fold FP binops with undef operands to NaN
authorSanjay Patel <spatel@rotateright.com>
Mon, 21 May 2018 23:54:19 +0000 (23:54 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 21 May 2018 23:54:19 +0000 (23:54 +0000)
commit2f6b67546d390b7aaf74d6eb2e349dc79318b2ee
tree4a990c63b5d1f8fc0dd1c08a0ff501eefe4bc9f0
parent1948145a6a5dd48c4bafe0cd304517bc7b04ce7c
[DAG] fold FP binops with undef operands to NaN

This is the FP sibling of D43141 with the corresponding IR change in rL327212.

We can't propagate undef here because if a variable operand is a NaN, these
binops must propagate NaN. Neither global nor node-level fast-math makes a
difference. If we have 'nnan', I think later folds can turn the NaN into undef.

The tests in X86/fp-undef.ll are meant to be the definitive verification for
these folds - everything reduces identically now.

The other test changes are collateral damage. They may need to be altered to
preserve their intent.

Differential Revision: https://reviews.llvm.org/D47026

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332920 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
test/CodeGen/AArch64/fcvt_combine.ll
test/CodeGen/AMDGPU/mad-mix-lo.ll
test/CodeGen/NVPTX/implicit-def.ll [deleted file]
test/CodeGen/X86/fp-undef.ll
test/CodeGen/X86/pr23103.ll
test/CodeGen/X86/vector-reduce-fadd.ll
test/CodeGen/X86/vector-reduce-fmul.ll