diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-06-04 10:04:55 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-06-04 10:04:55 +0000 |
commit | 3018d505a3643f1b191da1e2cc99493708ede186 (patch) | |
tree | c456866ca68719ea469a5a36979234bfedd6189e /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 08da01b496481ea079b2e213f6e67ef1fd1c6f29 (diff) | |
download | bcm5719-llvm-3018d505a3643f1b191da1e2cc99493708ede186.tar.gz bcm5719-llvm-3018d505a3643f1b191da1e2cc99493708ede186.zip |
[SelectionDAG] Add fpto[us]i(undef) --> undef constant fold
Follow up to D62807.
Differential Revision: https://reviews.llvm.org/D62811
llvm-svn: 362483
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 1dc9d7460f8..e30b702ac15 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -4440,6 +4440,11 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, if (Operand.isUndef()) return getUNDEF(VT); break; + case ISD::FP_TO_SINT: + case ISD::FP_TO_UINT: + if (Operand.isUndef()) + return getUNDEF(VT); + break; case ISD::SINT_TO_FP: case ISD::UINT_TO_FP: // [us]itofp(undef) = 0, because the result value is bounded. |