diff options
| author | Craig Topper <craig.topper@intel.com> | 2018-07-09 18:23:55 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2018-07-09 18:23:55 +0000 |
| commit | e3b0c7e5bd4d9e8e39a8ef8e0e039e7ddab9e0ad (patch) | |
| tree | 0997233787c871e00c558f227c3eaba02226e41b /llvm | |
| parent | 61d44f188ac3bb10505246ffb9185d2a0747db95 (diff) | |
| download | bcm5719-llvm-e3b0c7e5bd4d9e8e39a8ef8e0e039e7ddab9e0ad.tar.gz bcm5719-llvm-e3b0c7e5bd4d9e8e39a8ef8e0e039e7ddab9e0ad.zip | |
[SelectionDAG] Add VT consistency checks to the creation of ISD::FMA.
This is similar to what is done for binops. I don't know if this would have helped us catch the bug fixed in r336566 earlier or not, but I figured it couldn't hurt.
llvm-svn: 336576
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 1abc8c99efd..4b02b0cf9c5 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -4856,6 +4856,9 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, // Perform various simplifications. switch (Opcode) { case ISD::FMA: { + assert(VT.isFloatingPoint() && "This operator only applies to FP types!"); + assert(N1.getValueType() == VT && N2.getValueType() == VT && + N3.getValueType() == VT && "FMA types must match!"); ConstantFPSDNode *N1CFP = dyn_cast<ConstantFPSDNode>(N1); ConstantFPSDNode *N2CFP = dyn_cast<ConstantFPSDNode>(N2); ConstantFPSDNode *N3CFP = dyn_cast<ConstantFPSDNode>(N3); |

