[FPEnv] Fix chain handling for fpexcept.strict nodes
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Mon, 13 Jan 2020 13:37:07 +0000 (14:37 +0100)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Mon, 13 Jan 2020 13:38:49 +0000 (14:38 +0100)
commit04a86966fbf46809d7a165b1f089e4d076f0f8a5
tree29647c03311d2de4be6d3aad73bd80d3d6b22ed7
parentd7d88b9d8b3efd8b4b07074aa64b5b4136a35b2c
[FPEnv] Fix chain handling for fpexcept.strict nodes

We need to ensure that fpexcept.strict nodes are not optimized away even if
the result is unused. To do that, we need to chain them into the block's
terminator nodes, like already done for PendingExcepts.

This patch adds two new lists of pending chains, PendingConstrainedFP and
PendingConstrainedFPStrict to hold constrained FP intrinsic nodes without
and with fpexcept.strict markers. This allows not only to solve the above
problem, but also to relax chains a bit further by no longer flushing all
FP nodes before a store or other memory access. (They are still flushed
before nodes with other side effects.)

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D72341
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
llvm/test/CodeGen/PowerPC/ppcf128-constrained-fp-intrinsics.ll
llvm/test/CodeGen/SystemZ/fp-strict-alias.ll
llvm/test/CodeGen/SystemZ/vector-constrained-fp-intrinsics.ll
llvm/test/CodeGen/X86/fp-intrinsics.ll
llvm/test/CodeGen/X86/fp128-cast-strict.ll
llvm/test/CodeGen/X86/fp128-libcalls-strict.ll
llvm/test/CodeGen/X86/vector-constrained-fp-intrinsics-flags.ll
llvm/test/CodeGen/X86/vector-constrained-fp-intrinsics.ll