brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · 931a144 Raw
84 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 52; RUN: llc -mtriple=amdgcn -mcpu=hawaii -disable-promote-alloca-to-vector -disable-promote-alloca-to-lds < %s | FileCheck -check-prefix=GFX7 %s3; RUN: llc -mtriple=amdgcn -mcpu=tonga -disable-promote-alloca-to-vector -disable-promote-alloca-to-lds < %s | FileCheck -check-prefix=GFX8 %s4 5; Test that CopyToReg instructions don't have non-register operands prior6; to being emitted.7 8; Make sure this doesn't crash9 10define amdgpu_kernel void @copy_to_reg_frameindex(ptr addrspace(1) %out, i32 %a, i32 %b, i32 %c) {11; GFX7-LABEL: copy_to_reg_frameindex:12; GFX7:       ; %bb.0: ; %entry13; GFX7-NEXT:    s_mov_b32 s12, SCRATCH_RSRC_DWORD014; GFX7-NEXT:    s_mov_b32 s13, SCRATCH_RSRC_DWORD115; GFX7-NEXT:    s_mov_b32 s14, -116; GFX7-NEXT:    s_mov_b32 s15, 0xe8f00017; GFX7-NEXT:    s_add_u32 s12, s12, s1118; GFX7-NEXT:    s_addc_u32 s13, s13, 019; GFX7-NEXT:    s_mov_b32 s0, 020; GFX7-NEXT:    s_mov_b32 s1, 021; GFX7-NEXT:  .LBB0_1: ; %loop22; GFX7-NEXT:    ; =>This Inner Loop Header: Depth=123; GFX7-NEXT:    v_mov_b32_e32 v0, s124; GFX7-NEXT:    v_mov_b32_e32 v1, s025; GFX7-NEXT:    s_add_i32 s1, s1, 126; GFX7-NEXT:    s_add_i32 s0, s0, 427; GFX7-NEXT:    s_cmp_lt_u32 s1, 1628; GFX7-NEXT:    buffer_store_dword v0, v1, s[12:15], 0 offen29; GFX7-NEXT:    s_cbranch_scc1 .LBB0_130; GFX7-NEXT:  ; %bb.2: ; %done31; GFX7-NEXT:    buffer_load_dword v0, off, s[12:15], 032; GFX7-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x933; GFX7-NEXT:    s_mov_b32 s3, 0xf00034; GFX7-NEXT:    s_mov_b32 s2, -135; GFX7-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)36; GFX7-NEXT:    buffer_store_dword v0, off, s[0:3], 037; GFX7-NEXT:    s_endpgm38;39; GFX8-LABEL: copy_to_reg_frameindex:40; GFX8:       ; %bb.0: ; %entry41; GFX8-NEXT:    s_mov_b32 s88, SCRATCH_RSRC_DWORD042; GFX8-NEXT:    s_mov_b32 s89, SCRATCH_RSRC_DWORD143; GFX8-NEXT:    s_mov_b32 s90, -144; GFX8-NEXT:    s_mov_b32 s91, 0xe8000045; GFX8-NEXT:    s_add_u32 s88, s88, s1146; GFX8-NEXT:    s_addc_u32 s89, s89, 047; GFX8-NEXT:    s_mov_b32 s0, 048; GFX8-NEXT:    s_mov_b32 s1, 049; GFX8-NEXT:  .LBB0_1: ; %loop50; GFX8-NEXT:    ; =>This Inner Loop Header: Depth=151; GFX8-NEXT:    v_mov_b32_e32 v0, s152; GFX8-NEXT:    v_mov_b32_e32 v1, s053; GFX8-NEXT:    s_add_i32 s1, s1, 154; GFX8-NEXT:    s_add_i32 s0, s0, 455; GFX8-NEXT:    s_cmp_lt_u32 s1, 1656; GFX8-NEXT:    buffer_store_dword v0, v1, s[88:91], 0 offen57; GFX8-NEXT:    s_cbranch_scc1 .LBB0_158; GFX8-NEXT:  ; %bb.2: ; %done59; GFX8-NEXT:    buffer_load_dword v2, off, s[88:91], 060; GFX8-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x2461; GFX8-NEXT:    s_waitcnt lgkmcnt(0)62; GFX8-NEXT:    v_mov_b32_e32 v0, s063; GFX8-NEXT:    v_mov_b32_e32 v1, s164; GFX8-NEXT:    s_waitcnt vmcnt(0)65; GFX8-NEXT:    flat_store_dword v[0:1], v266; GFX8-NEXT:    s_endpgm67entry:68  %alloca = alloca [16 x i32], addrspace(5)69  br label %loop70 71loop:72  %inc = phi i32 [0, %entry], [%inc.i, %loop]73  %ptr = getelementptr [16 x i32], ptr addrspace(5) %alloca, i32 0, i32 %inc74  store i32 %inc, ptr addrspace(5) %ptr75  %inc.i = add i32 %inc, 176  %cnd = icmp uge i32 %inc.i, 1677  br i1 %cnd, label %done, label %loop78 79done:80  %tmp1 = load i32, ptr addrspace(5) %alloca81  store i32 %tmp1, ptr addrspace(1) %out82  ret void83}84