]> granicus.if.org Git - llvm/commitdiff
[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)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351055 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 3cff4c5c0fc1c644a7b0211de195e59151f153ed..23a7b3ece826da40b47b752805d274dc1839069a 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!");