Allow legalization of target-specific SDNodes, provided that the target itself provid...
authorOwen Anderson <resistor@mac.com>
Wed, 8 Aug 2012 23:31:14 +0000 (23:31 +0000)
committerOwen Anderson <resistor@mac.com>
Wed, 8 Aug 2012 23:31:14 +0000 (23:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161536 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetLowering.h

index f3113bd8f63fe5e8f34cce9b15d7a1c6bc7dca30..acf0419510e939b9e5c7f5f19de79a9b483ebc41 100644 (file)
@@ -366,7 +366,9 @@ public:
   /// for it.
   LegalizeAction getOperationAction(unsigned Op, EVT VT) const {
     if (VT.isExtended()) return Expand;
-    assert(Op < array_lengthof(OpActions[0]) && "Table isn't big enough!");
+    // If a target-specific SDNode requires legalization, require the target
+    // to provide custom legalization for it.
+    if (Op > array_lengthof(OpActions[0])) return Custom;
     unsigned I = (unsigned) VT.getSimpleVT().SimpleTy;
     return (LegalizeAction)OpActions[I][Op];
   }