1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=thumbv7m-none-eabi -run-pass=arm-cp-islands -verify-machineinstrs -o - %s | FileCheck %s
5 target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
6 target triple = "thumbv8.1m.main-arm-none-eabi"
8 @a = global i32 0, align 4
9 @b = local_unnamed_addr global i32 0, align 4
13 br i1 icmp eq (i8 trunc (i32 sdiv (i32 zext (i8 trunc (i32 lshr (i32 zext (i8 ptrtoint (i32* @a to i8) to i32), i32 6) to i8) to i32), i32 7) to i8), i8 0), label %if.then, label %safe_mod_func_int32_t_s_s.exit
15 safe_mod_func_int32_t_s_s.exit: ; preds = %entry
16 br i1 icmp eq (i32 srem (i32 6, i32 zext (i8 trunc (i32 sdiv (i32 zext (i8 trunc (i32 lshr (i32 zext (i8 ptrtoint (i32* @a to i8) to i32), i32 6) to i8) to i32), i32 7) to i8) to i32)), i32 0), label %if.end, label %if.then
18 if.then: ; preds = %safe_mod_func_int32_t_s_s.exit, %entry
19 %0 = load i32, i32* @b, align 4
20 %inc = add nsw i32 %0, 1
21 store i32 %inc, i32* @b, align 4
24 if.end: ; preds = %if.then, %safe_mod_func_int32_t_s_s.exit
32 tracksRegLiveness: true
34 ; CHECK-LABEL: name: c
36 ; CHECK: successors: %bb.2(0x40000000), %bb.1(0x40000000)
37 ; CHECK: renamable $r0, dead $cpsr = tMOVi8 1, 14 /* CC::al */, $noreg
38 ; CHECK: tCBNZ killed renamable $r0, %bb.2
39 ; CHECK: bb.1.safe_mod_func_int32_t_s_s.exit:
40 ; CHECK: successors: %bb.3(0x40000000), %bb.2(0x40000000)
41 ; CHECK: tCBZ undef renamable $r0, %bb.3
42 ; CHECK: bb.2.if.then:
43 ; CHECK: successors: %bb.3(0x80000000)
44 ; CHECK: $r0 = t2MOVi16 target-flags(arm-lo16) @b, 14 /* CC::al */, $noreg
45 ; CHECK: $r0 = t2MOVTi16 killed $r0, target-flags(arm-hi16) @b, 14 /* CC::al */, $noreg
46 ; CHECK: renamable $r1 = tLDRi renamable $r0, 0, 14 /* CC::al */, $noreg :: (dereferenceable load (s32) from @b)
47 ; CHECK: renamable $r1, dead $cpsr = nsw tADDi8 killed renamable $r1, 1, 14 /* CC::al */, $noreg
48 ; CHECK: tSTRi killed renamable $r1, killed renamable $r0, 0, 14 /* CC::al */, $noreg :: (store (s32) into @b)
50 ; CHECK: tBX_RET 14 /* CC::al */, $noreg, implicit undef $r0
52 successors: %bb.2(0x40000000), %bb.1(0x40000000)
54 renamable $r0, dead $cpsr = tMOVi8 1, 14 /* CC::al */, $noreg
55 tCMPi8 killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
56 t2Bcc %bb.2, 1 /* CC::ne */, killed $cpsr
58 bb.1.safe_mod_func_int32_t_s_s.exit:
59 successors: %bb.3(0x40000000), %bb.2(0x40000000)
61 tCMPi8 undef renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
62 t2Bcc %bb.3, 0 /* CC::eq */, killed $cpsr
65 successors: %bb.3(0x80000000)
67 $r0 = t2MOVi16 target-flags(arm-lo16) @b, 14 /* CC::al */, $noreg
68 $r0 = t2MOVTi16 killed $r0, target-flags(arm-hi16) @b, 14 /* CC::al */, $noreg
69 renamable $r1 = tLDRi renamable $r0, 0, 14 /* CC::al */, $noreg :: (dereferenceable load (s32) from @b)
70 renamable $r1, dead $cpsr = nsw tADDi8 killed renamable $r1, 1, 14 /* CC::al */, $noreg
71 tSTRi killed renamable $r1, killed renamable $r0, 0, 14 /* CC::al */, $noreg :: (store (s32) into @b)
74 tBX_RET 14 /* CC::al */, $noreg, implicit undef $r0