1 ; RUN: llc -mtriple=aarch64-linux-gnu -o - %s | FileCheck %s
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
9 %struct.Node = type { ptr, ptr }
11 define void @process_nodes(ptr %0) {
12 ; CHECK-LABEL: process_nodes:
13 ; CHECK-NOT: stp {{d[0-9]+}}
14 ; CHECK-LABEL: .LBB0_2:
15 ; CHECK: fmov s0, #1.00000000
18 %1 = icmp eq ptr %0, null
19 br i1 %1, label %exit, label %loop
22 %2 = phi ptr [ %4, %loop ], [ %0, %entry ]
23 tail call void @do_it(float 1.000000e+00, ptr nonnull %2)
24 %3 = getelementptr inbounds %struct.Node, ptr %2, i64 0, i32 0
25 %4 = load ptr, ptr %3, align 8
26 %5 = icmp eq ptr %4, null
27 br i1 %5, label %exit, label %loop
33 declare void @do_it(float, ptr)