1 ; RUN: llc -mtriple=amdgcn -mcpu=tahiti -verify-machineinstrs -amdgpu-s-branch-bits=5 < %s | FileCheck -check-prefix=GCN %s
3 ; Restrict maximum branch to between +15 and -16 dwords
5 ; Instructions inside a bundle were collectively counted as
6 ; 0-bytes. Make sure this is accounted for when estimating branch
9 ; Bundle used for address in call sequence: 20 bytes
14 ; plus additional overhead
16 ; and some register copies
18 declare void @func() #0
20 ; GCN-LABEL: {{^}}bundle_size:
21 ; GCN: s_cbranch_scc0 [[BB_EXPANSION:.LBB[0-9]+_[0-9]+]]
23 ; GCN-NEXT: .Lpost_getpc{{[0-9]+}}:{{$}}
25 ; GCN-NEXT: s_addc_u32
26 ; GCN-NEXT: s_setpc_b64
28 ; GCN: {{^}}[[BB_EXPANSION]]:
30 ; GCN: s_add_u32 s{{[0-9]+}}, s{{[0-9]+}}, func@
31 ; GCN: s_addc_u32 s{{[0-9]+}}, s{{[0-9]+}}, func@
33 define amdgpu_kernel void @bundle_size(ptr addrspace(1) %arg, i32 %cnd) #0 {
35 %cmp = icmp eq i32 %cnd, 0
36 br i1 %cmp, label %bb3, label %bb2 ; +8 dword branch
40 call void asm sideeffect
49 store volatile i32 %cnd, ptr addrspace(1) %arg
53 attributes #0 = { nounwind }
54 attributes #1 = { nounwind readnone }