1 ; RUN: llc -mtriple=thumbv7m-eabi %s -o - | FileCheck %s
3 ; See `bti-outliner-cost-1.ll`
5 @a = hidden global i32 0, align 4
6 @b = hidden global i32 0, align 4
7 @c = hidden global i32 0, align 4
8 @d = hidden global i32 0, align 4
9 @e = hidden global i32 0, align 4
11 define hidden i32 @x(i32 %p) local_unnamed_addr #0 {
13 %0 = load volatile i32, ptr @a, align 4
14 %1 = load volatile i32, ptr @b, align 4
15 %add = add nsw i32 %1, %0
16 %2 = load volatile i32, ptr @c, align 4
17 %3 = load volatile i32, ptr @d, align 4
18 %add1 = add nsw i32 %3, %2
19 %div = sdiv i32 %add, %add1
20 %4 = load volatile i32, ptr @e, align 4
21 %mul = mul nsw i32 %4, %div
22 %add2 = add nsw i32 %mul, 1
26 ; CHECK-NOT: bl OUTLINED_FUNCTION
28 define hidden i32 @y(i32 %p) local_unnamed_addr #0 {
30 %0 = load volatile i32, ptr @a, align 4
31 %1 = load volatile i32, ptr @b, align 4
32 %add = add nsw i32 %1, %0
33 %2 = load volatile i32, ptr @c, align 4
34 %3 = load volatile i32, ptr @d, align 4
35 %add1 = add nsw i32 %3, %2
36 %div = sdiv i32 %add, %add1
37 %4 = load volatile i32, ptr @e, align 4
38 %mul = mul nsw i32 %4, %div
39 %add2 = add nsw i32 %mul, 2
43 ; CHECK-NOT: bl OUTLINED_FUNCTION
45 ; CHECK-NOT: OUTLINED_FUNCTION
47 attributes #0 = { minsize nofree norecurse nounwind optsize "branch-target-enforcement" }