[llvm] 835cb9f - [DAG] getNode - add type assertion checks for ISD::ABDS/ABDU

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 21 03:32:13 PST 2023


Author: Simon Pilgrim
Date: 2023-01-21T11:31:55Z
New Revision: 835cb9ff4d1d75c08a4daa22373ae4035bd74aec

URL: https://github.com/llvm/llvm-project/commit/835cb9ff4d1d75c08a4daa22373ae4035bd74aec
DIFF: https://github.com/llvm/llvm-project/commit/835cb9ff4d1d75c08a4daa22373ae4035bd74aec.diff

LOG: [DAG] getNode - add type assertion checks for ISD::ABDS/ABDU

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 2fe85a0c6b907..7edfabbc5a01d 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -6216,6 +6216,12 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
         return getNode(ISD::AND, DL, VT, N1, getNOT(DL, N2, VT));
     }
     break;
+  case ISD::ABDS:
+  case ISD::ABDU:
+    assert(VT.isInteger() && "This operator does not apply to FP types!");
+    assert(N1.getValueType() == N2.getValueType() &&
+           N1.getValueType() == VT && "Binary operator types must match!");
+    break;
   case ISD::SMIN:
   case ISD::UMAX:
     assert(VT.isInteger() && "This operator does not apply to FP types!");


        


More information about the llvm-commits mailing list