inst-select-load-local-128.mir 8.98 KB
# RUN: llc -march=amdgcn -mcpu=hawaii -mattr=+enable-ds128 -run-pass=instruction-select -verify-machineinstrs  -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX7-DS128 %s

---

name: load_local_v4s32_align16
legalized:       true
regBankSelected: true
tracksRegLiveness: true

body: |
  bb.0:
    liveins:  $vgpr0

    ; GFX6-LABEL: name: load_local_v4s32_align16
    ; GFX6: liveins: $vgpr0
    ; GFX6: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX6: [[LOAD:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[COPY]](p3) :: (load 16, addrspace 3)
    ; GFX6: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<4 x s32>)
    ; GFX7-LABEL: name: load_local_v4s32_align16
    ; GFX7: liveins: $vgpr0
    ; GFX7: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX7: [[LOAD:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[COPY]](p3) :: (load 16, addrspace 3)
    ; GFX7: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<4 x s32>)
    ; GFX7-DS128-LABEL: name: load_local_v4s32_align16
    ; GFX7-DS128: liveins: $vgpr0
    ; GFX7-DS128: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
    ; GFX7-DS128: $m0 = S_MOV_B32 -1
    ; GFX7-DS128: [[DS_READ_B128_:%[0-9]+]]:vreg_128 = DS_READ_B128 [[COPY]], 0, 0, implicit $m0, implicit $exec :: (load 16, addrspace 3)
    ; GFX7-DS128: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[DS_READ_B128_]]
    ; GFX9-LABEL: name: load_local_v4s32_align16
    ; GFX9: liveins: $vgpr0
    ; GFX9: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX9: [[LOAD:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[COPY]](p3) :: (load 16, addrspace 3)
    ; GFX9: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<4 x s32>)
    %0:vgpr(p3) = COPY $vgpr0
    %1:vgpr(<4 x  s32>) = G_LOAD %0 :: (load 16, align 16, addrspace 3)
    $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1

...

---

name: load_local_v4s32_align_4
legalized:       true
regBankSelected: true
tracksRegLiveness: true

body: |
  bb.0:
    liveins:  $vgpr0

    ; GFX6-LABEL: name: load_local_v4s32_align_4
    ; GFX6: liveins: $vgpr0
    ; GFX6: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX6: [[LOAD:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX6: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<4 x s32>)
    ; GFX7-LABEL: name: load_local_v4s32_align_4
    ; GFX7: liveins: $vgpr0
    ; GFX7: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX7: [[LOAD:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX7: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<4 x s32>)
    ; GFX7-DS128-LABEL: name: load_local_v4s32_align_4
    ; GFX7-DS128: liveins: $vgpr0
    ; GFX7-DS128: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX7-DS128: $m0 = S_MOV_B32 -1
    ; GFX7-DS128: [[LOAD:%[0-9]+]]:vreg_128(<4 x s32>) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX7-DS128: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<4 x s32>)
    ; GFX9-LABEL: name: load_local_v4s32_align_4
    ; GFX9: liveins: $vgpr0
    ; GFX9: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX9: [[LOAD:%[0-9]+]]:vgpr(<4 x s32>) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX9: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<4 x s32>)
    %0:vgpr(p3) = COPY $vgpr0
    %1:vgpr(<4 x  s32>) = G_LOAD %0 :: (load 16, align 4, addrspace 3)
    $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1

...

---

name: load_local_v2s64
legalized:       true
regBankSelected: true
tracksRegLiveness: true

body: |
  bb.0:
    liveins:  $vgpr0

    ; GFX6-LABEL: name: load_local_v2s64
    ; GFX6: liveins: $vgpr0
    ; GFX6: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX6: [[LOAD:%[0-9]+]]:vgpr(<2 x s64>) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX6: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<2 x s64>)
    ; GFX7-LABEL: name: load_local_v2s64
    ; GFX7: liveins: $vgpr0
    ; GFX7: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX7: [[LOAD:%[0-9]+]]:vgpr(<2 x s64>) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX7: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<2 x s64>)
    ; GFX7-DS128-LABEL: name: load_local_v2s64
    ; GFX7-DS128: liveins: $vgpr0
    ; GFX7-DS128: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX7-DS128: $m0 = S_MOV_B32 -1
    ; GFX7-DS128: [[LOAD:%[0-9]+]]:vreg_128(<2 x s64>) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX7-DS128: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<2 x s64>)
    ; GFX9-LABEL: name: load_local_v2s64
    ; GFX9: liveins: $vgpr0
    ; GFX9: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX9: [[LOAD:%[0-9]+]]:vgpr(<2 x s64>) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX9: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<2 x s64>)
    %0:vgpr(p3) = COPY $vgpr0
    %1:vgpr(<2 x s64>) = G_LOAD %0 :: (load 16, align 4, addrspace 3)
    $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1

...

---

name: load_local_v2p1
legalized:       true
regBankSelected: true
tracksRegLiveness: true

body: |
  bb.0:
    liveins:  $vgpr0

    ; GFX6-LABEL: name: load_local_v2p1
    ; GFX6: liveins: $vgpr0
    ; GFX6: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX6: [[LOAD:%[0-9]+]]:vgpr(<2 x p1>) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX6: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<2 x p1>)
    ; GFX7-LABEL: name: load_local_v2p1
    ; GFX7: liveins: $vgpr0
    ; GFX7: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX7: [[LOAD:%[0-9]+]]:vgpr(<2 x p1>) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX7: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<2 x p1>)
    ; GFX7-DS128-LABEL: name: load_local_v2p1
    ; GFX7-DS128: liveins: $vgpr0
    ; GFX7-DS128: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX7-DS128: $m0 = S_MOV_B32 -1
    ; GFX7-DS128: [[LOAD:%[0-9]+]]:vreg_128(<2 x p1>) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX7-DS128: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<2 x p1>)
    ; GFX9-LABEL: name: load_local_v2p1
    ; GFX9: liveins: $vgpr0
    ; GFX9: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX9: [[LOAD:%[0-9]+]]:vgpr(<2 x p1>) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX9: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<2 x p1>)
    %0:vgpr(p3) = COPY $vgpr0
    %1:vgpr(<2 x p1>) = G_LOAD %0 :: (load 16, align 4, addrspace 3)
    $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1

...

---

name: load_local_s128
legalized:       true
regBankSelected: true
tracksRegLiveness: true

body: |
  bb.0:
    liveins:  $vgpr0

    ; GFX6-LABEL: name: load_local_s128
    ; GFX6: liveins: $vgpr0
    ; GFX6: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX6: [[LOAD:%[0-9]+]]:vgpr(s128) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX6: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](s128)
    ; GFX7-LABEL: name: load_local_s128
    ; GFX7: liveins: $vgpr0
    ; GFX7: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX7: [[LOAD:%[0-9]+]]:vgpr(s128) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX7: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](s128)
    ; GFX7-DS128-LABEL: name: load_local_s128
    ; GFX7-DS128: liveins: $vgpr0
    ; GFX7-DS128: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX7-DS128: $m0 = S_MOV_B32 -1
    ; GFX7-DS128: [[LOAD:%[0-9]+]]:vreg_128(s128) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX7-DS128: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](s128)
    ; GFX9-LABEL: name: load_local_s128
    ; GFX9: liveins: $vgpr0
    ; GFX9: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX9: [[LOAD:%[0-9]+]]:vgpr(s128) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX9: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](s128)
    %0:vgpr(p3) = COPY $vgpr0
    %1:vgpr(s128) = G_LOAD %0 :: (load 16, align 4, addrspace 3)
    $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1

...

---

name: load_local_v8s16
legalized:       true
regBankSelected: true
tracksRegLiveness: true

body: |
  bb.0:
    liveins:  $vgpr0

    ; GFX6-LABEL: name: load_local_v8s16
    ; GFX6: liveins: $vgpr0
    ; GFX6: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX6: [[LOAD:%[0-9]+]]:vgpr(<8 x s16>) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX6: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<8 x s16>)
    ; GFX7-LABEL: name: load_local_v8s16
    ; GFX7: liveins: $vgpr0
    ; GFX7: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX7: [[LOAD:%[0-9]+]]:vgpr(<8 x s16>) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX7: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<8 x s16>)
    ; GFX7-DS128-LABEL: name: load_local_v8s16
    ; GFX7-DS128: liveins: $vgpr0
    ; GFX7-DS128: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX7-DS128: $m0 = S_MOV_B32 -1
    ; GFX7-DS128: [[LOAD:%[0-9]+]]:vreg_128(<8 x s16>) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX7-DS128: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<8 x s16>)
    ; GFX9-LABEL: name: load_local_v8s16
    ; GFX9: liveins: $vgpr0
    ; GFX9: [[COPY:%[0-9]+]]:vgpr(p3) = COPY $vgpr0
    ; GFX9: [[LOAD:%[0-9]+]]:vgpr(<8 x s16>) = G_LOAD [[COPY]](p3) :: (load 16, align 4, addrspace 3)
    ; GFX9: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[LOAD]](<8 x s16>)
    %0:vgpr(p3) = COPY $vgpr0
    %1:vgpr(<8 x  s16>) = G_LOAD %0 :: (load 16, align 4, addrspace 3)
    $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1

...