aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorKevin P. Neal <kevin.neal@sas.com>2019-05-13 13:23:30 +0000
committerKevin P. Neal <kevin.neal@sas.com>2019-05-13 13:23:30 +0000
commit5987749e33bbe4d8dd43b26f39165fcfd9cdcfdf (patch)
tree2f62678e66e88a512fab9be089c691a38db0a5c7 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parentd5fb162563986951ddc4d20dccd735b8257605e0 (diff)
downloadllvm-5987749e33bbe4d8dd43b26f39165fcfd9cdcfdf.zip
llvm-5987749e33bbe4d8dd43b26f39165fcfd9cdcfdf.tar.gz
llvm-5987749e33bbe4d8dd43b26f39165fcfd9cdcfdf.tar.bz2
Add constrained fptrunc and fpext intrinsics.
The new fptrunc and fpext intrinsics are constrained versions of the regular fptrunc and fpext instructions. Reviewed by: Andrew Kaylor, Craig Topper, Cameron McInally, Conner Abbot Approved by: Craig Topper Differential Revision: https://reviews.llvm.org/D55897 llvm-svn: 360581
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 3597c6d..df42d45 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -7611,6 +7611,10 @@ SDNode* SelectionDAG::mutateStrictFPToFP(SDNode *Node) {
case ISD::STRICT_FFLOOR: NewOpc = ISD::FFLOOR; IsUnary = true; break;
case ISD::STRICT_FROUND: NewOpc = ISD::FROUND; IsUnary = true; break;
case ISD::STRICT_FTRUNC: NewOpc = ISD::FTRUNC; IsUnary = true; break;
+ // STRICT_FP_ROUND takes an extra argument describing whether or not
+ // the value will be changed by this node. See ISDOpcodes.h for details.
+ case ISD::STRICT_FP_ROUND: NewOpc = ISD::FP_ROUND; break;
+ case ISD::STRICT_FP_EXTEND: NewOpc = ISD::FP_EXTEND; IsUnary = true; break;
}
// We're taking this node out of the chain, so we need to re-link things.
@@ -7618,8 +7622,19 @@ SDNode* SelectionDAG::mutateStrictFPToFP(SDNode *Node) {
SDValue OutputChain = SDValue(Node, 1);
ReplaceAllUsesOfValueWith(OutputChain, InputChain);
- SDVTList VTs = getVTList(Node->getOperand(1).getValueType());
+ SDVTList VTs;
SDNode *Res = nullptr;
+
+ switch (OrigOpc) {
+ default:
+ VTs = getVTList(Node->getOperand(1).getValueType());
+ break;
+ case ISD::STRICT_FP_ROUND:
+ case ISD::STRICT_FP_EXTEND:
+ VTs = getVTList(Node->getValueType(0));
+ break;
+ }
+
if (IsUnary)
Res = MorphNodeTo(Node, NewOpc, VTs, { Node->getOperand(1) });
else if (IsTernary)