1 ; RUN: llc -verify-machineinstrs %s -o - | FileCheck %s
2 target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
3 target triple = "thumbv7m-unknown-unknown-eabi"
5 declare dso_local i32 @t(i32) local_unnamed_addr #0
7 define dso_local i32 @f(i32 %a, i32 %b, i32 %c) local_unnamed_addr #0 {
9 %mul = mul nsw i32 %a, 3
10 %add = add nsw i32 %mul, 1
11 %sub = add nsw i32 %b, -1
12 %div = sdiv i32 %add, %sub
13 %sub1 = sub nsw i32 %a, %c
14 %div2 = sdiv i32 %div, %sub1
15 %mul3 = mul nsw i32 %div2, %b
16 %add4 = add nsw i32 %mul3, 1
17 %call = tail call i32 @t(i32 %add4) #0
21 ; CHECK: str lr, [sp, #-8]!
22 ; CHECK-NEXT: bl OUTLINED_FUNCTION_0
23 ; CHECK-NEXT: ldr lr, [sp], #8
24 ; CHECK-NEXT: adds r0, #1
27 define dso_local i32 @g(i32 %a, i32 %b, i32 %c) local_unnamed_addr #0 {
29 %mul = mul nsw i32 %a, 3
30 %add = add nsw i32 %mul, 1
31 %sub = add nsw i32 %b, -1
32 %div = sdiv i32 %add, %sub
33 %sub1 = sub nsw i32 %a, %c
34 %div2 = sdiv i32 %div, %sub1
35 %mul3 = mul nsw i32 %div2, %b
36 %add4 = add nsw i32 %mul3, 3
37 %call = tail call i32 @t(i32 %add4) #0
42 ; CHECK: str lr, [sp, #-8]!
43 ; CHECK-NEXT: bl OUTLINED_FUNCTION_0
44 ; CHECK-NEXT: ldr lr, [sp], #8
45 ; CHECK-NEXT: adds r0, #3
48 ; CHECK-LABEL: OUTLINED_FUNCTION_0:
52 attributes #0 = { minsize nounwind optsize }