[llvm-commits] [llvm] r161536 - /llvm/trunk/include/llvm/Target/TargetLowering.h

Owen Anderson resistor at mac.com
Wed Aug 8 16:31:15 PDT 2012


Author: resistor
Date: Wed Aug  8 18:31:14 2012
New Revision: 161536

URL: http://llvm.org/viewvc/llvm-project?rev=161536&view=rev
Log:
Allow legalization of target-specific SDNodes, provided that the target itself provide a legalization hook for them.

Modified:
    llvm/trunk/include/llvm/Target/TargetLowering.h

Modified: llvm/trunk/include/llvm/Target/TargetLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=161536&r1=161535&r2=161536&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetLowering.h (original)
+++ llvm/trunk/include/llvm/Target/TargetLowering.h Wed Aug  8 18:31:14 2012
@@ -366,7 +366,9 @@
   /// 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];
   }





More information about the llvm-commits mailing list