[llvm] r336576 - [SelectionDAG] Add VT consistency checks to the creation of ISD::FMA.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 9 11:23:55 PDT 2018
Author: ctopper
Date: Mon Jul 9 11:23:55 2018
New Revision: 336576
URL: http://llvm.org/viewvc/llvm-project?rev=336576&view=rev
Log:
[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.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=336576&r1=336575&r2=336576&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Jul 9 11:23:55 2018
@@ -4856,6 +4856,9 @@ SDValue SelectionDAG::getNode(unsigned O
// 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);
More information about the llvm-commits
mailing list