brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.6 KiB · d9a6eb6 Raw
160 lines · plain
1# RUN: llc -mtriple=amdgcn -mcpu=gfx803 -run-pass si-memory-legalizer  %s -o - | FileCheck %s2 3--- |4  define amdgpu_kernel void @multiple_mem_operands(ptr addrspace(1) %out, i32 %cond, i32 %if_offset, i32 %else_offset) #0 {5  entry:6    %scratch0 = alloca [8192 x i32], addrspace(5)7    %scratch1 = alloca [8192 x i32], addrspace(5)8    %scratchptr01 = bitcast ptr addrspace(5) %scratch0 to ptr addrspace(5)9    store i32 1, ptr addrspace(5) %scratchptr0110    %scratchptr12 = bitcast ptr addrspace(5) %scratch1 to ptr addrspace(5)11    store i32 2, ptr addrspace(5) %scratchptr1212    %cmp = icmp eq i32 %cond, 013    br i1 %cmp, label %if, label %else, !structurizecfg.uniform !0, !amdgpu.uniform !014 15  if:                                               ; preds = %entry16    %if_ptr = getelementptr [8192 x i32], ptr addrspace(5) %scratch0, i32 0, i32 %if_offset, !amdgpu.uniform !017    %if_value = load i32, ptr addrspace(5) %if_ptr, align 4, !nontemporal !118    br label %done, !structurizecfg.uniform !019 20  else:                                             ; preds = %entry21    %else_ptr = getelementptr [8192 x i32], ptr addrspace(5) %scratch1, i32 0, i32 %else_offset, !amdgpu.uniform !022    %else_value = load i32, ptr addrspace(5) %else_ptr, align 4, !nontemporal !123    br label %done, !structurizecfg.uniform !024 25  done:                                             ; preds = %else, %if26    %value = phi i32 [ %if_value, %if ], [ %else_value, %else ]27    store i32 %value, ptr addrspace(1) %out28    ret void29  }30 31  ; Function Attrs: convergent nounwind32  declare { i1, i64 } @llvm.amdgcn.if(i1) #133 34  ; Function Attrs: convergent nounwind35  declare { i1, i64 } @llvm.amdgcn.else(i64) #136 37  ; Function Attrs: convergent nounwind readnone38  declare i64 @llvm.amdgcn.break(i64) #239 40  ; Function Attrs: convergent nounwind readnone41  declare i64 @llvm.amdgcn.if.break(i1, i64) #242 43  ; Function Attrs: convergent nounwind readnone44  declare i64 @llvm.amdgcn.else.break(i64, i64) #245 46  ; Function Attrs: convergent nounwind47  declare i1 @llvm.amdgcn.loop(i64) #148 49  ; Function Attrs: convergent nounwind50  declare void @llvm.amdgcn.end.cf(i64) #151 52  attributes #0 = { "target-cpu"="gfx803" }53  attributes #1 = { convergent nounwind }54  attributes #2 = { convergent nounwind readnone }55 56  !0 = !{}57  !1 = !{i32 1}58 59...60---61 62# CHECK-LABEL: name: multiple_mem_operands63 64# CHECK-LABEL: bb.3.done:65# CHECK: BUFFER_LOAD_DWORD_OFFEN killed $vgpr0, killed $sgpr8_sgpr9_sgpr10_sgpr11, $sgpr3, 0, 366 67name:            multiple_mem_operands68alignment:       169exposesReturnsTwice: false70legalized:       false71regBankSelected: false72selected:        false73tracksRegLiveness: true74registers:75liveins:76  - { reg: '$sgpr0_sgpr1', virtual-reg: '' }77  - { reg: '$sgpr3', virtual-reg: '' }78frameInfo:79  isFrameAddressTaken: false80  isReturnAddressTaken: false81  hasStackMap:     false82  hasPatchPoint:   false83  stackSize:       6554084  offsetAdjustment: 085  maxAlignment:    486  adjustsStack:    false87  hasCalls:        false88  stackProtector:  ''89  maxCallFrameSize: 090  hasOpaqueSPAdjustment: false91  hasVAStart:      false92  hasMustTailInVarArgFunc: false93  savePoint:       []94  restorePoint:    []95fixedStack:96  - { id: 0, type: default, offset: 0, size: 4, alignment: 4, stack-id: default,97      isImmutable: false, isAliased: false, callee-saved-register: '' }98stack:99  - { id: 0, name: scratch0, type: default, offset: 4, size: 32768, alignment: 4,100      stack-id: default, callee-saved-register: '', local-offset: 0,101      debug-info-variable: '', debug-info-expression: '',102      debug-info-location: '' }103  - { id: 1, name: scratch1, type: default, offset: 32772, size: 32768,104      alignment: 4, stack-id: default, callee-saved-register: '', local-offset: 32768,105      debug-info-variable: '', debug-info-expression: '',106      debug-info-location: '' }107constants:108body:             |109  bb.0.entry:110    successors: %bb.1.if(0x30000000), %bb.2.else(0x50000000)111    liveins: $sgpr0_sgpr1, $sgpr3112 113    $sgpr2 = S_LOAD_DWORD_IMM $sgpr0_sgpr1, 44, 0 :: (non-temporal dereferenceable invariant load (s32) from `ptr addrspace(4) poison`)114    $sgpr8 = S_MOV_B32 &SCRATCH_RSRC_DWORD0, implicit-def $sgpr8_sgpr9_sgpr10_sgpr11115    $sgpr4_sgpr5 = S_LOAD_DWORDX2_IMM $sgpr0_sgpr1, 36, 0 :: (non-temporal dereferenceable invariant load (s64) from `ptr addrspace(4) poison`)116    $sgpr9 = S_MOV_B32 &SCRATCH_RSRC_DWORD1, implicit-def $sgpr8_sgpr9_sgpr10_sgpr11117    $sgpr10 = S_MOV_B32 4294967295, implicit-def $sgpr8_sgpr9_sgpr10_sgpr11118    $sgpr11 = S_MOV_B32 15204352, implicit-def $sgpr8_sgpr9_sgpr10_sgpr11119    $vgpr0 = V_MOV_B32_e32 1, implicit $exec120    BUFFER_STORE_DWORD_OFFSET killed $vgpr0, $sgpr8_sgpr9_sgpr10_sgpr11, $sgpr3, 4, 0, 0, implicit $exec :: (store (s32) into %ir.scratchptr01)121    S_WAITCNT 127122    S_CMP_LG_U32 killed $sgpr2, 0, implicit-def $scc123    S_WAITCNT 3855124    $vgpr0 = V_MOV_B32_e32 2, implicit $exec125    $vgpr1 = V_MOV_B32_e32 32772, implicit $exec126    BUFFER_STORE_DWORD_OFFEN killed $vgpr0, killed $vgpr1, $sgpr8_sgpr9_sgpr10_sgpr11, $sgpr3, 0, 0, 0, implicit $exec :: (store (s32) into %ir.scratchptr12)127    S_CBRANCH_SCC0 %bb.1.if, implicit killed $scc128 129  bb.2.else:130    successors: %bb.3.done(0x80000000)131    liveins: $sgpr0_sgpr1, $sgpr4_sgpr5, $sgpr3, $sgpr8_sgpr9_sgpr10_sgpr11132 133    $sgpr0 = S_LOAD_DWORD_IMM killed $sgpr0_sgpr1, 52, 0 :: (non-temporal dereferenceable invariant load (s32) from `ptr addrspace(4) poison`)134    S_WAITCNT 3855135    $vgpr0 = V_MOV_B32_e32 32772, implicit $exec136    S_BRANCH %bb.3.done137 138  bb.1.if:139    successors: %bb.3.done(0x80000000)140    liveins: $sgpr0_sgpr1, $sgpr4_sgpr5, $sgpr3, $sgpr8_sgpr9_sgpr10_sgpr11141 142    $sgpr0 = S_LOAD_DWORD_IMM killed $sgpr0_sgpr1, 48, 0 :: (non-temporal dereferenceable invariant load (s32) from `ptr addrspace(4) poison`)143    S_WAITCNT 3855144    $vgpr0 = V_MOV_B32_e32 4, implicit $exec145 146  bb.3.done:147    liveins: $sgpr3, $sgpr4_sgpr5, $sgpr8_sgpr9_sgpr10_sgpr11, $vgpr0, $sgpr0148 149    S_WAITCNT 127150    $sgpr0 = S_LSHL_B32 killed $sgpr0, 2, implicit-def dead $scc151    $vgpr0 = V_ADD_CO_U32_e32 killed $sgpr0, killed $vgpr0, implicit-def dead $vcc, implicit $exec152    $vgpr0 = BUFFER_LOAD_DWORD_OFFEN killed $vgpr0, killed $sgpr8_sgpr9_sgpr10_sgpr11, $sgpr3, 0, 0, 0, implicit $exec :: (non-temporal load (s32) from %ir.else_ptr), (non-temporal load (s32) from %ir.if_ptr)153    $vgpr1 = V_MOV_B32_e32 $sgpr4, implicit $exec, implicit-def $vgpr1_vgpr2, implicit $sgpr4_sgpr5154    $vgpr2 = V_MOV_B32_e32 killed $sgpr5, implicit $exec, implicit $sgpr4_sgpr5, implicit $exec155    S_WAITCNT 3952156    FLAT_STORE_DWORD killed $vgpr1_vgpr2, killed $vgpr0, 0, 0, implicit $exec, implicit $flat_scr :: (store (s32) into %ir.out)157    S_ENDPGM 0158 159...160