[SelectionDAG] Add type sanity assertions for add/sub saturation node creation.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 14 Jan 2019 11:56:59 +0000 (11:56 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 14 Jan 2019 11:56:59 +0000 (11:56 +0000)
llvm-svn: 351055

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 3cff4c5..23a7b3e 100644 (file)
@@ -4827,6 +4827,10 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
   case ISD::SMAX:
   case ISD::UMIN:
   case ISD::UMAX:
+  case ISD::SADDSAT:
+  case ISD::SSUBSAT:
+  case ISD::UADDSAT:
+  case ISD::USUBSAT:
     assert(VT.isInteger() && "This operator does not apply to FP types!");
     assert(N1.getValueType() == N2.getValueType() &&
            N1.getValueType() == VT && "Binary operator types must match!");