diff options
| author | Tom Stellard <thomas.stellard@amd.com> | 2016-02-12 23:45:29 +0000 |
|---|---|---|
| committer | Tom Stellard <thomas.stellard@amd.com> | 2016-02-12 23:45:29 +0000 |
| commit | bc4497b13ccc73e1c8c156350cc7fe50f9beae93 (patch) | |
| tree | 71e7e13564f64f708f17731941d9b73818cb5be9 /llvm/test/CodeGen/AMDGPU/salu-to-valu.ll | |
| parent | 0de36ec169b8c818487606658ed2504c88f4c0e7 (diff) | |
| download | bcm5719-llvm-bc4497b13ccc73e1c8c156350cc7fe50f9beae93.tar.gz bcm5719-llvm-bc4497b13ccc73e1c8c156350cc7fe50f9beae93.zip | |
AMDGPU/SI: Detect uniform branches and emit s_cbranch instructions
Reviewers: arsenm
Subscribers: mareko, MatzeB, qcolombet, arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D16603
llvm-svn: 260765
Diffstat (limited to 'llvm/test/CodeGen/AMDGPU/salu-to-valu.ll')
| -rw-r--r-- | llvm/test/CodeGen/AMDGPU/salu-to-valu.ll | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/salu-to-valu.ll b/llvm/test/CodeGen/AMDGPU/salu-to-valu.ll index f92b53db2a8..eebd06e6ee9 100644 --- a/llvm/test/CodeGen/AMDGPU/salu-to-valu.ll +++ b/llvm/test/CodeGen/AMDGPU/salu-to-valu.ll @@ -431,5 +431,33 @@ entry: ret void } +; Make sure we legalize vopc operands after moving an sopc to the value. + +; {{^}}sopc_vopc_legalize_bug: +; GCN: s_load_dword [[SGPR:s[0-9]+]] +; GCN: v_cmp_le_u32_e32 vcc, [[SGPR]], v{{[0-9]+}} +; GCN: s_and_b64 vcc, exec, vcc +; GCN: s_cbranch_vccnz [[EXIT:[A-Z0-9_]+]] +; GCN: v_mov_b32_e32 [[ONE:v[0-9]+]], 1 +; GCN-NOHSA: buffer_store_dword [[ONE]] +; GCN-HSA: flat_store_dword v[{{[0-9]+:[0-9]+}}], [[ONE]] +; GCN; {{^}}[[EXIT]]: +; GCN: s_endpgm +define void @sopc_vopc_legalize_bug(i32 %cond, i32 addrspace(1)* %out, i32 addrspace(1)* %in) { +bb3: ; preds = %bb2 + %tmp0 = bitcast i32 %cond to float + %tmp1 = fadd float %tmp0, 2.500000e-01 + %tmp2 = bitcast float %tmp1 to i32 + %tmp3 = icmp ult i32 %tmp2, %cond + br i1 %tmp3, label %bb6, label %bb7 + +bb6: + store i32 1, i32 addrspace(1)* %out + br label %bb7 + +bb7: ; preds = %bb3 + ret void +} + attributes #0 = { nounwind readnone } attributes #1 = { nounwind } |

