Set operation actions to legal types only.
authorNadav Rotem <nadav.rotem@intel.com>
Tue, 4 Oct 2011 12:05:35 +0000 (12:05 +0000)
committerNadav Rotem <nadav.rotem@intel.com>
Tue, 4 Oct 2011 12:05:35 +0000 (12:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141075 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CellSPU/SPUISelLowering.cpp

index 03bfb4ee71e7bfb0a3d4241071a8b585c6cbe5ae..ac33111f74ae74510064c1351b1e742171e7d9a4 100644 (file)
@@ -402,6 +402,9 @@ SPUTargetLowering::SPUTargetLowering(SPUTargetMachine &TM)
        i <= (unsigned)MVT::LAST_VECTOR_VALUETYPE; ++i) {
     MVT::SimpleValueType VT = (MVT::SimpleValueType)i;
 
+    // Set operation actions to legal types only.
+    if (!isTypeLegal(VT)) continue;
+
     // add/sub are legal for all supported vector VT's.
     setOperationAction(ISD::ADD,     VT, Legal);
     setOperationAction(ISD::SUB,     VT, Legal);
@@ -423,14 +426,12 @@ SPUTargetLowering::SPUTargetLowering(SPUTargetMachine &TM)
 
     // Custom lower build_vector, constant pool spills, insert and
     // extract vector elements:
-    if (isTypeLegal(VT)) {
-      setOperationAction(ISD::BUILD_VECTOR, VT, Custom);
-      setOperationAction(ISD::ConstantPool, VT, Custom);
-      setOperationAction(ISD::SCALAR_TO_VECTOR, VT, Custom);
-      setOperationAction(ISD::EXTRACT_VECTOR_ELT, VT, Custom);
-      setOperationAction(ISD::INSERT_VECTOR_ELT, VT, Custom);
-      setOperationAction(ISD::VECTOR_SHUFFLE, VT, Custom);
-    }
+    setOperationAction(ISD::BUILD_VECTOR, VT, Custom);
+    setOperationAction(ISD::ConstantPool, VT, Custom);
+    setOperationAction(ISD::SCALAR_TO_VECTOR, VT, Custom);
+    setOperationAction(ISD::EXTRACT_VECTOR_ELT, VT, Custom);
+    setOperationAction(ISD::INSERT_VECTOR_ELT, VT, Custom);
+    setOperationAction(ISD::VECTOR_SHUFFLE, VT, Custom);
   }
 
   setOperationAction(ISD::AND, MVT::v16i8, Custom);