2016-05-26 01:58:27 +08:00
|
|
|
; RUN: llc -O0 -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCNNOOPT -check-prefix=GCN %s
|
2017-01-25 06:02:15 +08:00
|
|
|
; RUN: llc -O0 -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -amdgpu-spill-sgpr-to-smem=0 -verify-machineinstrs < %s | FileCheck -check-prefix=GCNNOOPT -check-prefix=GCN %s
|
2016-05-26 01:58:27 +08:00
|
|
|
; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCNOPT -check-prefix=GCN %s
|
2017-01-25 06:02:15 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefix=GCNOPT -check-prefix=GCN %s
|
2014-03-02 05:45:41 +08:00
|
|
|
|
2016-05-26 01:58:27 +08:00
|
|
|
; GCN-LABEL: {{^}}test_branch:
|
|
|
|
; GCNNOOPT: v_writelane_b32
|
|
|
|
; GCNNOOPT: v_writelane_b32
|
|
|
|
; GCN: s_cbranch_scc1 [[END:BB[0-9]+_[0-9]+]]
|
|
|
|
|
2016-12-06 09:02:51 +08:00
|
|
|
|
2016-05-26 01:58:27 +08:00
|
|
|
; GCN: ; BB#1
|
|
|
|
; GCNNOOPT: v_readlane_b32
|
|
|
|
; GCNNOOPT: v_readlane_b32
|
|
|
|
; GCN: buffer_store_dword
|
2016-12-06 09:02:51 +08:00
|
|
|
; GCNOPT-NEXT: s_waitcnt vmcnt(0) expcnt(0)
|
|
|
|
; TODO: This waitcnt can be eliminated
|
2016-05-26 01:58:27 +08:00
|
|
|
|
2016-12-06 09:02:51 +08:00
|
|
|
; GCN: {{^}}[[END]]:
|
2016-05-26 01:58:27 +08:00
|
|
|
; GCN: s_endpgm
|
|
|
|
define void @test_branch(i32 addrspace(1)* noalias %out, i32 addrspace(1)* noalias %in, i32 %val) #0 {
|
2014-03-02 05:45:41 +08:00
|
|
|
%cmp = icmp ne i32 %val, 0
|
|
|
|
br i1 %cmp, label %store, label %end
|
|
|
|
|
|
|
|
store:
|
|
|
|
store i32 222, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
|
|
|
|
end:
|
|
|
|
ret void
|
|
|
|
}
|
2016-05-26 01:58:27 +08:00
|
|
|
|
|
|
|
; GCN-LABEL: {{^}}test_brcc_i1:
|
|
|
|
; GCN: buffer_load_ubyte
|
|
|
|
; GCN: v_and_b32_e32 v{{[0-9]+}}, 1,
|
2016-09-30 09:50:20 +08:00
|
|
|
; GCN: v_cmp_eq_u32_e32 vcc,
|
2016-05-26 01:58:27 +08:00
|
|
|
; GCN: s_cbranch_vccnz [[END:BB[0-9]+_[0-9]+]]
|
|
|
|
|
|
|
|
; GCN: buffer_store_dword
|
2016-12-06 09:02:51 +08:00
|
|
|
; GCNOPT-NEXT: s_waitcnt vmcnt(0) expcnt(0)
|
|
|
|
; TODO: This waitcnt can be eliminated
|
2016-05-26 01:58:27 +08:00
|
|
|
|
2016-12-06 09:02:51 +08:00
|
|
|
; GCN: {{^}}[[END]]:
|
2016-05-26 01:58:27 +08:00
|
|
|
; GCN: s_endpgm
|
|
|
|
define void @test_brcc_i1(i32 addrspace(1)* noalias %out, i32 addrspace(1)* noalias %in, i1 %val) #0 {
|
|
|
|
%cmp0 = icmp ne i1 %val, 0
|
|
|
|
br i1 %cmp0, label %store, label %end
|
|
|
|
|
|
|
|
store:
|
|
|
|
store i32 222, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
|
|
|
|
end:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
attributes #0 = { nounwind }
|