]> granicus.if.org Git - llvm/commit
[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)
commitb413eefa644725fbd5910d84d686c95d0f256ad5
treeaa1fa78791a2eba1b1307c699a9799a42f5a9d84
parentb6730a33abdd46507e8b35bc7bc84a40fbb62d32
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359566 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
test/CodeGen/AArch64/fp-const-fold.ll
test/CodeGen/X86/fdiv-combine.ll