Operations should be custom lowered only if their type is legal.
authorNadav Rotem <nadav.rotem@intel.com>
Tue, 4 Oct 2011 10:03:32 +0000 (10:03 +0000)
committerNadav Rotem <nadav.rotem@intel.com>
Tue, 4 Oct 2011 10:03:32 +0000 (10:03 +0000)
Test: CellSPU/v2i32.ll when running with -promote-elements

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141074 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CellSPU/SPUISelLowering.cpp

index cfd29cf90dda3182ac8ccfb334a7dde3a7b5b5af..03bfb4ee71e7bfb0a3d4241071a8b585c6cbe5ae 100644 (file)
@@ -423,12 +423,14 @@ SPUTargetLowering::SPUTargetLowering(SPUTargetMachine &TM)
 
     // Custom lower build_vector, constant pool spills, insert and
     // extract vector elements:
-    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);
+    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::AND, MVT::v16i8, Custom);