[SelectionDAG] remove div-by-zero constant folding restriction
authorSanjay Patel <spatel@rotateright.com>
Tue, 30 Apr 2019 14:37:15 +0000 (14:37 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 30 Apr 2019 14:37:15 +0000 (14:37 +0000)
commit0387bf5269114d2607dda6a53e370d0a3d5e7103
tree92ba34ff5e69e99153527e4e0c00415e0ee880b1
parent24896d304df91f0093f033acd53c95120b18f5ac
[SelectionDAG] remove div-by-zero constant folding restriction

We don't have this restriction in IR, so it should not be here
either simply out of consistency. Code that wants to handle FP
exceptions is expected to use the 'strict' variants of these
nodes.

We don't get the frem case because frem by 0.0 produces NaN (invalid),
and that's the remaining check here (so the removed check for frem
was dead code AFAIK).

This is the only place in SDAG that uses "HasFPExceptions", so I
think we should remove that entirely as a follow-up patch.

llvm-svn: 359566
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/test/CodeGen/AArch64/fp-const-fold.ll
llvm/test/CodeGen/X86/fdiv-combine.ll