1; RUN: llc -mtriple=aarch64-linux-gnu -o - %s | FileCheck %s
2
3; The purpose of this test is to check that an FMOV instruction that
4; only materializes an immediate is not MachineLICM'd out of a loop.
5; We check this in two ways: by looking for the FMOV inside the loop,
6; and also by checking that we're not spilling any FP callee-saved
7; registers.
8
9%struct.Node = type { %struct.Node*, i8* }
10
11define void @process_nodes(%struct.Node* %0) {
12; CHECK-LABEL: process_nodes:
13; CHECK-NOT:   stp {{d[0-9]+}}
14; CHECK-LABEL: .LBB0_2:
15; CHECK:       fmov s0, #1.00000000
16; CHECK:       bl do_it
17entry:
18  %1 = icmp eq %struct.Node* %0, null
19  br i1 %1, label %exit, label %loop
20
21loop:
22  %2 = phi %struct.Node* [ %4, %loop ], [ %0, %entry ]
23  tail call void @do_it(float 1.000000e+00, %struct.Node* nonnull %2)
24  %3 = getelementptr inbounds %struct.Node, %struct.Node* %2, i64 0, i32 0
25  %4 = load %struct.Node*, %struct.Node** %3, align 8
26  %5 = icmp eq %struct.Node* %4, null
27  br i1 %5, label %exit, label %loop
28
29exit:
30  ret void
31}
32
33declare void @do_it(float, %struct.Node*)
34