blob: 679e3f434733c3362b5b690be31893379b0f7f9c [file] [log] [blame]
Jakob Stoklund Olesene8ee9d12012-04-16 20:49:06 +00001; RUN: llc < %s -widen-vmovs -mcpu=cortex-a8 -verify-machineinstrs -disable-code-place | FileCheck %s
Jakob Stoklund Olesen39c31a72011-10-12 00:06:23 +00002target triple = "thumbv7-apple-ios"
3
Lang Hames323a5ce2012-03-29 23:52:38 +00004; The 1.0e+10 constant is loaded from the constant pool and kept in a register.
Jakob Stoklund Olesen39c31a72011-10-12 00:06:23 +00005; CHECK: %entry
Jim Grosbach3e2c6f32011-11-14 23:03:21 +00006; CHECK: vldr s
Jakob Stoklund Olesen39c31a72011-10-12 00:06:23 +00007; The float loop variable is initialized with a vmovs from the constant register.
8; The vmovs is first widened to a vmovd, and then converted to a vorr because of the v2f32 vadd.f32.
9; CHECK: vorr [[DL:d[0-9]+]], [[DN:d[0-9]+]]
10; CHECK: , [[DN]]
11; CHECK: %for.body.i
12; CHECK: vadd.f32 [[DL]], [[DL]], [[DN]]
Jakob Stoklund Olesene8ee9d12012-04-16 20:49:06 +000013; CHECK: %rInnerproduct.exit
Jakob Stoklund Olesen39c31a72011-10-12 00:06:23 +000014;
15; This test is verifying:
16; - The VMOVS widening is happening.
17; - Register liveness is verified.
18; - The execution domain switch to vorr works across basic blocks.
19
20define void @Mm() nounwind {
21entry:
22 br label %for.body4
23
24for.body4:
25 br label %for.body.i
26
27for.body.i:
Lang Hames323a5ce2012-03-29 23:52:38 +000028 %tmp3.i = phi float [ 1.000000e+10, %for.body4 ], [ %add.i, %for.body.i ]
29 %add.i = fadd float %tmp3.i, 1.000000e+10
Jakob Stoklund Olesen39c31a72011-10-12 00:06:23 +000030 %exitcond.i = icmp eq i32 undef, 41
31 br i1 %exitcond.i, label %rInnerproduct.exit, label %for.body.i
32
33rInnerproduct.exit:
34 store float %add.i, float* undef, align 4
35 br label %for.body4
36}