1 # RUN: llc -mtriple=thumbv7-none-eabi -run-pass=arm-cp-islands %s -o - | FileCheck %s
3 # This checks alignment of a new block when a big basic block is split up.
7 source_filename = "<stdin>"
8 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
9 target triple = "thumbv7-arm--eabi"
11 declare i32 @llvm.arm.space(i32, i32) #0
13 define dso_local i32 @THUMB(i32 %A.coerce) local_unnamed_addr #1 {
15 %F = alloca float, align 4
16 %S = alloca half, align 2
17 %tmp.0.extract.trunc = trunc i32 %A.coerce to i16
18 %0 = bitcast i16 %tmp.0.extract.trunc to half
19 store volatile float 4.200000e+01, ptr %F, align 4
20 store volatile half 0xH3C00, ptr %S, align 2
21 %S.0.S.0.142 = load volatile half, ptr %S, align 2
22 %1 = call i32 @llvm.arm.space(i32 1230, i32 undef)
23 %add42 = fadd half %S.0.S.0.142, 0xH2E66
24 store volatile half %add42, ptr %S, align 2
25 %2 = call i32 @llvm.arm.space(i32 1330, i32 undef)
26 %S.0.S.0.119 = load volatile half, ptr %S, align 2
27 %3 = bitcast half %add42 to i16
28 %tmp87.0.insert.ext = zext i16 %3 to i32
29 ret i32 %tmp87.0.insert.ext
32 attributes #0 = { nounwind }
33 attributes #1 = { minsize nounwind optsize "target-features"="+crc,+crypto,+dsp,+fp-armv8,+fullfp16,+hwdiv,+hwdiv-arm,+neon,+ras,+strict-align,+thumb-mode" }
39 tracksRegLiveness: true
45 - { id: 0, name: F, offset: -4, size: 4, alignment: 4, stack-id: default, local-offset: -4 }
46 - { id: 1, name: S, offset: -6, size: 2, alignment: 2, stack-id: default, local-offset: -6 }
55 #CHECK: t2B %[[BB3:bb.[0-9]]]
56 #CHECK: bb.{{.}} (align 4):
58 #CHECK: CONSTPOOL_ENTRY 2, %const.{{.}}, 4
59 #CHECK: bb.{{.}} (align 2):
61 #CHECK: CONSTPOOL_ENTRY 3, %const.{{.}}, 2
62 #CHECK: [[BB3]].entry (align 2):
66 $sp = frame-setup tSUBspi $sp, 2, 14, $noreg
67 frame-setup CFI_INSTRUCTION def_cfa_offset 8
68 renamable $r0 = tLDRpci %const.0, 14, $noreg :: (load (s32) from constant-pool)
69 renamable $s0 = FCONSTH 112, 14, $noreg
70 tSTRspi killed renamable $r0, $sp, 1, 14, $noreg :: (volatile store (s32) into %ir.F)
71 VSTRH killed renamable $s0, $sp, 1, 14, $noreg :: (volatile store (s16) into %ir.S)
72 renamable $s2 = VLDRH $sp, 1, 14, $noreg :: (volatile dereferenceable load (s16) from %ir.S)
73 renamable $s0 = VLDRH %const.1, 0, 14, $noreg :: (load (s16) from constant-pool)
74 dead renamable $r0 = SPACE 1230, undef renamable $r0
75 renamable $s0 = VADDH killed renamable $s2, killed renamable $s0, 14, $noreg
76 VSTRH renamable $s0, $sp, 1, 14, $noreg :: (volatile store (s16) into %ir.S)
77 renamable $r0 = VMOVRH killed renamable $s0, 14, $noreg
78 dead renamable $r1 = SPACE 1330, undef renamable $r0
79 dead renamable $s0 = VLDRH $sp, 1, 14, $noreg :: (volatile dereferenceable load (s16) from %ir.S)
80 $sp = tADDspi $sp, 2, 14, $noreg
81 tBX_RET 14, $noreg, implicit killed $r0