1 ; RUN: llc -march=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:BB[0-9]+_[0-9]+]]
24 ; GCN-NEXT: s_addc_u32
25 ; GCN-NEXT: s_setpc_b64
27 ; GCN: {{^}}[[BB_EXPANSION]]:
29 ; GCN: s_add_u32 s{{[0-9]+}}, s{{[0-9]+}}, func@
30 ; GCN: s_addc_u32 s{{[0-9]+}}, s{{[0-9]+}}, func@
32 define amdgpu_kernel void @bundle_size(i32 addrspace(1)* %arg, i32 %cnd) #0 {
34 %cmp = icmp eq i32 %cnd, 0
35 br i1 %cmp, label %bb3, label %bb2 ; +8 dword branch
39 call void asm sideeffect
48 store volatile i32 %cnd, i32 addrspace(1)* %arg
52 attributes #0 = { nounwind }
53 attributes #1 = { nounwind readnone }