xref: /aosp_15_r20/external/llvm/test/CodeGen/ARM/widen-vmovs.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mcpu=cortex-a8 -verify-machineinstrs -disable-block-placement | FileCheck %s
2*9880d681SAndroid Build Coastguard Workertarget triple = "thumbv7-apple-ios"
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; The 1.0e+10 constant is loaded from the constant pool and kept in a register.
5*9880d681SAndroid Build Coastguard Worker; CHECK: %entry
6*9880d681SAndroid Build Coastguard Worker; CHECK: vldr s
7*9880d681SAndroid Build Coastguard Worker; The float loop variable is initialized with a vmovs from the constant register.
8*9880d681SAndroid Build Coastguard Worker; The vmovs is first widened to a vmovd, and then converted to a vorr because of the v2f32 vadd.f32.
9*9880d681SAndroid Build Coastguard Worker; CHECK: vorr [[DL:d[0-9]+]], [[DN:d[0-9]+]]
10*9880d681SAndroid Build Coastguard Worker; CHECK: , [[DN]]
11*9880d681SAndroid Build Coastguard Worker; CHECK: %for.body.i
12*9880d681SAndroid Build Coastguard Worker; CHECK: vadd.f32 [[DL]], [[DL]], [[DN]]
13*9880d681SAndroid Build Coastguard Worker; CHECK: %rInnerproduct.exit
14*9880d681SAndroid Build Coastguard Worker;
15*9880d681SAndroid Build Coastguard Worker; This test is verifying:
16*9880d681SAndroid Build Coastguard Worker; - The VMOVS widening is happening.
17*9880d681SAndroid Build Coastguard Worker; - Register liveness is verified.
18*9880d681SAndroid Build Coastguard Worker; - The execution domain switch to vorr works across basic blocks.
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Workerdefine void @Mm(i32 %in, float* %addr) nounwind {
21*9880d681SAndroid Build Coastguard Workerentry:
22*9880d681SAndroid Build Coastguard Worker  br label %for.body4
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Workerfor.body4:
25*9880d681SAndroid Build Coastguard Worker  br label %for.body.i
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Workerfor.body.i:
28*9880d681SAndroid Build Coastguard Worker  %tmp3.i = phi float [ 1.000000e+10, %for.body4 ], [ %add.i, %for.body.i ]
29*9880d681SAndroid Build Coastguard Worker  %add.i = fadd float %tmp3.i, 1.000000e+10
30*9880d681SAndroid Build Coastguard Worker  %exitcond.i = icmp eq i32 %in, 41
31*9880d681SAndroid Build Coastguard Worker  br i1 %exitcond.i, label %rInnerproduct.exit, label %for.body.i
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard WorkerrInnerproduct.exit:
34*9880d681SAndroid Build Coastguard Worker  store float %add.i, float* %addr, align 4
35*9880d681SAndroid Build Coastguard Worker  br label %for.body4
36*9880d681SAndroid Build Coastguard Worker}
37