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