Two sets of changes. Sorry they are intermingled.
[oota-llvm.git] / test / CodeGen / ARM / 2010-09-17-vmovrrd-combine.ll
1 ; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s
2 ; Radar 8407927: Make sure that VMOVRRD gets optimized away when the result is
3 ; converted back to be used as a vector type.
4
5 ; CHECK: test:
6 define <4 x i32> @test() nounwind {
7 entry:
8   br i1 undef, label %bb1, label %bb2
9
10 bb1:
11   %0 = bitcast <2 x i64> zeroinitializer to <2 x double>
12   %1 = extractelement <2 x double> %0, i32 0
13   %2 = bitcast double %1 to i64
14   %3 = insertelement <1 x i64> undef, i64 %2, i32 0
15 ; CHECK-NOT: vmov s
16 ; CHECK: vext.8
17   %4 = shufflevector <1 x i64> %3, <1 x i64> undef, <2 x i32> <i32 0, i32 1>
18   %tmp2006.3 = bitcast <2 x i64> %4 to <16 x i8>
19   %5 = shufflevector <16 x i8> %tmp2006.3, <16 x i8> undef, <16 x i32> <i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19>
20   %tmp2004.3 = bitcast <16 x i8> %5 to <4 x i32>
21   br i1 undef, label %bb2, label %bb1
22
23 bb2:
24   %result = phi <4 x i32> [ undef, %entry ], [ %tmp2004.3, %bb1 ]
25   ret <4 x i32> %result
26 }