Add obvious missing case to switch. PR10497.
authorEli Friedman <eli.friedman@gmail.com>
Tue, 26 Jul 2011 20:38:49 +0000 (20:38 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Tue, 26 Jul 2011 20:38:49 +0000 (20:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136130 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
test/CodeGen/X86/split-vector-bitcast.ll [new file with mode: 0644]

index c8454bf28ee208f9ce8b492f21e18843423689af..8747d276e7817e474e17a3ae331ecf7db7aa9294 100644 (file)
@@ -524,12 +524,11 @@ void DAGTypeLegalizer::SplitVecRes_BITCAST(SDNode *N, SDValue &Lo,
 
   // Handle some special cases efficiently.
   switch (getTypeAction(InVT)) {
-  default:
-    assert(false && "Unknown type action!");
   case TargetLowering::TypeLegal:
   case TargetLowering::TypePromoteInteger:
   case TargetLowering::TypeSoftenFloat:
   case TargetLowering::TypeScalarizeVector:
+  case TargetLowering::TypeWidenVector:
     break;
   case TargetLowering::TypeExpandInteger:
   case TargetLowering::TypeExpandFloat:
diff --git a/test/CodeGen/X86/split-vector-bitcast.ll b/test/CodeGen/X86/split-vector-bitcast.ll
new file mode 100644 (file)
index 0000000..55ba07d
--- /dev/null
@@ -0,0 +1,12 @@
+; RUN: llc < %s -march=x86 -mattr=-sse2,+sse | grep addps
+
+; PR10497
+; (This is primarily checking that this construct doesn't crash.)
+define void @a(<2 x float>* %a, <2 x i32>* %b) {
+  %cc = load <2 x float>* %a
+  %c = fadd <2 x float> %cc, %cc
+  %dd = bitcast <2 x float> %c to <2 x i32>
+  %d = add <2 x i32> %dd, %dd
+  store <2 x i32> %d, <2 x i32>* %b
+  ret void
+}