ARM: stop asserting on weird <3 x Ty> vectors in ISelLowering.
authorTim Northover <tnorthover@apple.com>
Thu, 17 Mar 2016 20:10:28 +0000 (20:10 +0000)
committerTim Northover <tnorthover@apple.com>
Thu, 17 Mar 2016 20:10:28 +0000 (20:10 +0000)
llvm-svn: 263741

llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/test/CodeGen/ARM/vcvt_combine.ll
llvm/test/CodeGen/ARM/vdiv_combine.ll

index bb470c2..9cd880d 100644 (file)
@@ -10124,7 +10124,8 @@ static SDValue PerformVCVTCombine(SDNode *N, SelectionDAG &DAG,
     return SDValue();
 
   SDValue Op = N->getOperand(0);
-  if (!Op.getValueType().isVector() || Op.getOpcode() != ISD::FMUL)
+  if (!Op.getValueType().isVector() || !Op.getValueType().isSimple() ||
+      Op.getOpcode() != ISD::FMUL)
     return SDValue();
 
   SDValue ConstVec = Op->getOperand(1);
@@ -10181,7 +10182,7 @@ static SDValue PerformVDIVCombine(SDNode *N, SelectionDAG &DAG,
 
   SDValue Op = N->getOperand(0);
   unsigned OpOpcode = Op.getNode()->getOpcode();
-  if (!N->getValueType(0).isVector() ||
+  if (!N->getValueType(0).isVector() || !N->getValueType(0).isSimple() ||
       (OpOpcode != ISD::SINT_TO_FP && OpOpcode != ISD::UINT_TO_FP))
     return SDValue();
 
index 9a8f084..11bed5a 100644 (file)
@@ -62,3 +62,11 @@ define <4 x i32> @t5(<4 x float> %in) {
   %vcvt.i = fptosi <4 x float> %mul.i to <4 x i32>
   ret <4 x i32> %vcvt.i
 }
+
+; CHECK-LABEL: test_illegal_fp_to_int:
+; CHECK: vcvt.s32.f32 {{q[0-9]+}}, {{q[0-9]+}}, #2
+define <3 x i32> @test_illegal_fp_to_int(<3 x float> %in) {
+  %scale = fmul <3 x float> %in, <float 4.0, float 4.0, float 4.0>
+  %val = fptosi <3 x float> %scale to <3 x i32>
+  ret <3 x i32> %val
+}
\ No newline at end of file
index 8511dbc..4a6c36b 100644 (file)
@@ -153,3 +153,11 @@ define <4 x float> @test8(<4 x i32> %in) {
   %div.i = fdiv <4 x float> %vcvt.i, <float 2.0, float 2.0, float 2.0, float undef>
   ret <4 x float> %div.i
 }
+
+; CHECK-LABEL: test_illegal_int_to_fp:
+; CHECK: vcvt.f32.s32
+define <3 x float> @test_illegal_int_to_fp(<3 x i32> %in) {
+  %conv = sitofp <3 x i32> %in to <3 x float>
+  %res = fdiv <3 x float> %conv, <float 4.0, float 4.0, float 4.0>
+  ret <3 x float> %res
+}
\ No newline at end of file