llvm-project/llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-widen-scalar-...

494 lines
22 KiB
YAML

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -global-isel -march=amdgcn -mcpu=fiji -run-pass=regbankselect -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX8 %s
# RUN: llc -global-isel -march=amdgcn -mcpu=gfx900 -run-pass=regbankselect -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX9 %s
# RUN: llc -global-isel -march=amdgcn -mcpu=gfx1010 -run-pass=regbankselect -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX10 %s
---
name: constant_load_i8_align8
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: constant_load_i8_align8
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), align 8, addrspace 4)
; GFX8: S_ENDPGM 0, implicit [[LOAD]](s32)
; GFX9-LABEL: name: constant_load_i8_align8
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), align 8, addrspace 4)
; GFX9: S_ENDPGM 0, implicit [[LOAD]](s32)
; GFX10-LABEL: name: constant_load_i8_align8
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), align 8, addrspace 4)
; GFX10: S_ENDPGM 0, implicit [[LOAD]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_LOAD %0 :: (invariant load (s8), align 8, addrspace 4)
S_ENDPGM 0, implicit %1
...
---
name: constant_load_i8_align4
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: constant_load_i8_align4
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 4)
; GFX8: S_ENDPGM 0, implicit [[LOAD]](s32)
; GFX9-LABEL: name: constant_load_i8_align4
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 4)
; GFX9: S_ENDPGM 0, implicit [[LOAD]](s32)
; GFX10-LABEL: name: constant_load_i8_align4
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 4)
; GFX10: S_ENDPGM 0, implicit [[LOAD]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_LOAD %0 :: (invariant load (s8), align 4, addrspace 4)
S_ENDPGM 0, implicit %1
...
---
name: constant_load_i16_align4
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: constant_load_i16_align4
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 4)
; GFX8: S_ENDPGM 0, implicit [[LOAD]](s32)
; GFX9-LABEL: name: constant_load_i16_align4
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 4)
; GFX9: S_ENDPGM 0, implicit [[LOAD]](s32)
; GFX10-LABEL: name: constant_load_i16_align4
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 4)
; GFX10: S_ENDPGM 0, implicit [[LOAD]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_LOAD %0 :: (invariant load (s16), align 4, addrspace 4)
S_ENDPGM 0, implicit %1
...
---
name: constant_sextload_i8_align4
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: constant_sextload_i8_align4
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 4)
; GFX8: [[SEXT_INREG:%[0-9]+]]:sgpr(s32) = G_SEXT_INREG [[LOAD]], 8
; GFX8: S_ENDPGM 0, implicit [[SEXT_INREG]](s32)
; GFX9-LABEL: name: constant_sextload_i8_align4
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 4)
; GFX9: [[SEXT_INREG:%[0-9]+]]:sgpr(s32) = G_SEXT_INREG [[LOAD]], 8
; GFX9: S_ENDPGM 0, implicit [[SEXT_INREG]](s32)
; GFX10-LABEL: name: constant_sextload_i8_align4
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 4)
; GFX10: [[SEXT_INREG:%[0-9]+]]:sgpr(s32) = G_SEXT_INREG [[LOAD]], 8
; GFX10: S_ENDPGM 0, implicit [[SEXT_INREG]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_SEXTLOAD %0 :: (invariant load (s8), align 4, addrspace 4)
S_ENDPGM 0, implicit %1
...
---
name: constant_sextload_i16_align4
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: constant_sextload_i16_align4
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 4)
; GFX8: [[SEXT_INREG:%[0-9]+]]:sgpr(s32) = G_SEXT_INREG [[LOAD]], 16
; GFX8: S_ENDPGM 0, implicit [[SEXT_INREG]](s32)
; GFX9-LABEL: name: constant_sextload_i16_align4
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 4)
; GFX9: [[SEXT_INREG:%[0-9]+]]:sgpr(s32) = G_SEXT_INREG [[LOAD]], 16
; GFX9: S_ENDPGM 0, implicit [[SEXT_INREG]](s32)
; GFX10-LABEL: name: constant_sextload_i16_align4
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 4)
; GFX10: [[SEXT_INREG:%[0-9]+]]:sgpr(s32) = G_SEXT_INREG [[LOAD]], 16
; GFX10: S_ENDPGM 0, implicit [[SEXT_INREG]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_SEXTLOAD %0 :: (invariant load (s16), align 4, addrspace 4)
S_ENDPGM 0, implicit %1
...
---
name: constant_zextload_i8_align4
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: constant_zextload_i8_align4
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 4)
; GFX8: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 255
; GFX8: [[AND:%[0-9]+]]:sgpr(s32) = G_AND [[LOAD]], [[C]]
; GFX8: S_ENDPGM 0, implicit [[AND]](s32)
; GFX9-LABEL: name: constant_zextload_i8_align4
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 4)
; GFX9: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 255
; GFX9: [[AND:%[0-9]+]]:sgpr(s32) = G_AND [[LOAD]], [[C]]
; GFX9: S_ENDPGM 0, implicit [[AND]](s32)
; GFX10-LABEL: name: constant_zextload_i8_align4
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 4)
; GFX10: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 255
; GFX10: [[AND:%[0-9]+]]:sgpr(s32) = G_AND [[LOAD]], [[C]]
; GFX10: S_ENDPGM 0, implicit [[AND]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_ZEXTLOAD %0 :: (invariant load (s8), align 4, addrspace 4)
S_ENDPGM 0, implicit %1
...
---
name: constant_zextload_i16_align4
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: constant_zextload_i16_align4
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 4)
; GFX8: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 65535
; GFX8: [[AND:%[0-9]+]]:sgpr(s32) = G_AND [[LOAD]], [[C]]
; GFX8: S_ENDPGM 0, implicit [[AND]](s32)
; GFX9-LABEL: name: constant_zextload_i16_align4
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 4)
; GFX9: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 65535
; GFX9: [[AND:%[0-9]+]]:sgpr(s32) = G_AND [[LOAD]], [[C]]
; GFX9: S_ENDPGM 0, implicit [[AND]](s32)
; GFX10-LABEL: name: constant_zextload_i16_align4
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 4)
; GFX10: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 65535
; GFX10: [[AND:%[0-9]+]]:sgpr(s32) = G_AND [[LOAD]], [[C]]
; GFX10: S_ENDPGM 0, implicit [[AND]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_ZEXTLOAD %0 :: (invariant load (s16), align 4, addrspace 4)
S_ENDPGM 0, implicit %1
...
---
name: global_load_i8_align4
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: global_load_i8_align4
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 1)
; GFX8: S_ENDPGM 0, implicit [[LOAD]](s32)
; GFX9-LABEL: name: global_load_i8_align4
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 1)
; GFX9: S_ENDPGM 0, implicit [[LOAD]](s32)
; GFX10-LABEL: name: global_load_i8_align4
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 1)
; GFX10: S_ENDPGM 0, implicit [[LOAD]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_LOAD %0 :: (invariant load (s8), align 4, addrspace 1)
S_ENDPGM 0, implicit %1
...
---
name: global_load_i16_align4
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: global_load_i16_align4
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 1)
; GFX8: S_ENDPGM 0, implicit [[LOAD]](s32)
; GFX9-LABEL: name: global_load_i16_align4
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 1)
; GFX9: S_ENDPGM 0, implicit [[LOAD]](s32)
; GFX10-LABEL: name: global_load_i16_align4
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 1)
; GFX10: S_ENDPGM 0, implicit [[LOAD]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_LOAD %0 :: (invariant load (s16), align 4, addrspace 1)
S_ENDPGM 0, implicit %1
...
---
name: global_sextload_i8_alig4
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: global_sextload_i8_alig4
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 1)
; GFX8: [[SEXT_INREG:%[0-9]+]]:sgpr(s32) = G_SEXT_INREG [[LOAD]], 8
; GFX8: S_ENDPGM 0, implicit [[SEXT_INREG]](s32)
; GFX9-LABEL: name: global_sextload_i8_alig4
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 1)
; GFX9: [[SEXT_INREG:%[0-9]+]]:sgpr(s32) = G_SEXT_INREG [[LOAD]], 8
; GFX9: S_ENDPGM 0, implicit [[SEXT_INREG]](s32)
; GFX10-LABEL: name: global_sextload_i8_alig4
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 1)
; GFX10: [[SEXT_INREG:%[0-9]+]]:sgpr(s32) = G_SEXT_INREG [[LOAD]], 8
; GFX10: S_ENDPGM 0, implicit [[SEXT_INREG]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_SEXTLOAD %0 :: (invariant load (s8), align 4, addrspace 1)
S_ENDPGM 0, implicit %1
...
---
name: global_zextload_i16_align4
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: global_zextload_i16_align4
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 1)
; GFX8: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 65535
; GFX8: [[AND:%[0-9]+]]:sgpr(s32) = G_AND [[LOAD]], [[C]]
; GFX8: S_ENDPGM 0, implicit [[AND]](s32)
; GFX9-LABEL: name: global_zextload_i16_align4
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 1)
; GFX9: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 65535
; GFX9: [[AND:%[0-9]+]]:sgpr(s32) = G_AND [[LOAD]], [[C]]
; GFX9: S_ENDPGM 0, implicit [[AND]](s32)
; GFX10-LABEL: name: global_zextload_i16_align4
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[LOAD:%[0-9]+]]:sgpr(s32) = G_LOAD [[COPY]](p1) :: (invariant load (s32), addrspace 1)
; GFX10: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 65535
; GFX10: [[AND:%[0-9]+]]:sgpr(s32) = G_AND [[LOAD]], [[C]]
; GFX10: S_ENDPGM 0, implicit [[AND]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_ZEXTLOAD %0 :: (invariant load (s16), align 4, addrspace 1)
S_ENDPGM 0, implicit %1
...
# Some negative test cases
---
name: constant_load_i8_align2
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: constant_load_i8_align2
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX8: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p1) :: (invariant load (s8), align 2, addrspace 4)
; GFX8: S_ENDPGM 0, implicit [[LOAD]](s32)
; GFX9-LABEL: name: constant_load_i8_align2
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX9: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p1) :: (invariant load (s8), align 2, addrspace 4)
; GFX9: S_ENDPGM 0, implicit [[LOAD]](s32)
; GFX10-LABEL: name: constant_load_i8_align2
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX10: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p1) :: (invariant load (s8), align 2, addrspace 4)
; GFX10: S_ENDPGM 0, implicit [[LOAD]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_LOAD %0 :: (invariant load (s8), align 2, addrspace 4)
S_ENDPGM 0, implicit %1
...
---
name: constant_load_i16_align2
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: constant_load_i16_align2
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX8: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p1) :: (invariant load (s16), addrspace 4)
; GFX8: S_ENDPGM 0, implicit [[LOAD]](s32)
; GFX9-LABEL: name: constant_load_i16_align2
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX9: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p1) :: (invariant load (s16), addrspace 4)
; GFX9: S_ENDPGM 0, implicit [[LOAD]](s32)
; GFX10-LABEL: name: constant_load_i16_align2
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX10: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p1) :: (invariant load (s16), addrspace 4)
; GFX10: S_ENDPGM 0, implicit [[LOAD]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_LOAD %0 :: (invariant load (s16), align 2, addrspace 4)
S_ENDPGM 0, implicit %1
...
---
name: constant_sextload_i8_align2
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: constant_sextload_i8_align2
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX8: [[SEXTLOAD:%[0-9]+]]:vgpr(s32) = G_SEXTLOAD [[COPY1]](p1) :: (invariant load (s8), align 2, addrspace 4)
; GFX8: S_ENDPGM 0, implicit [[SEXTLOAD]](s32)
; GFX9-LABEL: name: constant_sextload_i8_align2
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX9: [[SEXTLOAD:%[0-9]+]]:vgpr(s32) = G_SEXTLOAD [[COPY1]](p1) :: (invariant load (s8), align 2, addrspace 4)
; GFX9: S_ENDPGM 0, implicit [[SEXTLOAD]](s32)
; GFX10-LABEL: name: constant_sextload_i8_align2
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX10: [[SEXTLOAD:%[0-9]+]]:vgpr(s32) = G_SEXTLOAD [[COPY1]](p1) :: (invariant load (s8), align 2, addrspace 4)
; GFX10: S_ENDPGM 0, implicit [[SEXTLOAD]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_SEXTLOAD %0 :: (invariant load (s8), align 2, addrspace 4)
S_ENDPGM 0, implicit %1
...
---
name: constant_sextload_i16_align2
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: constant_sextload_i16_align2
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX8: [[SEXTLOAD:%[0-9]+]]:vgpr(s32) = G_SEXTLOAD [[COPY1]](p1) :: (invariant load (s16), addrspace 4)
; GFX8: S_ENDPGM 0, implicit [[SEXTLOAD]](s32)
; GFX9-LABEL: name: constant_sextload_i16_align2
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX9: [[SEXTLOAD:%[0-9]+]]:vgpr(s32) = G_SEXTLOAD [[COPY1]](p1) :: (invariant load (s16), addrspace 4)
; GFX9: S_ENDPGM 0, implicit [[SEXTLOAD]](s32)
; GFX10-LABEL: name: constant_sextload_i16_align2
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX10: [[SEXTLOAD:%[0-9]+]]:vgpr(s32) = G_SEXTLOAD [[COPY1]](p1) :: (invariant load (s16), addrspace 4)
; GFX10: S_ENDPGM 0, implicit [[SEXTLOAD]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_SEXTLOAD %0 :: (invariant load (s16), align 2, addrspace 4)
S_ENDPGM 0, implicit %1
...
---
name: constant_zextload_i8_align2
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: constant_zextload_i8_align2
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX8: [[ZEXTLOAD:%[0-9]+]]:vgpr(s32) = G_ZEXTLOAD [[COPY1]](p1) :: (invariant load (s8), align 2, addrspace 4)
; GFX8: S_ENDPGM 0, implicit [[ZEXTLOAD]](s32)
; GFX9-LABEL: name: constant_zextload_i8_align2
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX9: [[ZEXTLOAD:%[0-9]+]]:vgpr(s32) = G_ZEXTLOAD [[COPY1]](p1) :: (invariant load (s8), align 2, addrspace 4)
; GFX9: S_ENDPGM 0, implicit [[ZEXTLOAD]](s32)
; GFX10-LABEL: name: constant_zextload_i8_align2
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX10: [[ZEXTLOAD:%[0-9]+]]:vgpr(s32) = G_ZEXTLOAD [[COPY1]](p1) :: (invariant load (s8), align 2, addrspace 4)
; GFX10: S_ENDPGM 0, implicit [[ZEXTLOAD]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_ZEXTLOAD %0 :: (invariant load (s8), align 2, addrspace 4)
S_ENDPGM 0, implicit %1
...
---
name: constant_zextload_i16_align2
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: constant_zextload_i16_align2
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX8: [[ZEXTLOAD:%[0-9]+]]:vgpr(s32) = G_ZEXTLOAD [[COPY1]](p1) :: (invariant load (s16), addrspace 4)
; GFX8: S_ENDPGM 0, implicit [[ZEXTLOAD]](s32)
; GFX9-LABEL: name: constant_zextload_i16_align2
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX9: [[ZEXTLOAD:%[0-9]+]]:vgpr(s32) = G_ZEXTLOAD [[COPY1]](p1) :: (invariant load (s16), addrspace 4)
; GFX9: S_ENDPGM 0, implicit [[ZEXTLOAD]](s32)
; GFX10-LABEL: name: constant_zextload_i16_align2
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX10: [[ZEXTLOAD:%[0-9]+]]:vgpr(s32) = G_ZEXTLOAD [[COPY1]](p1) :: (invariant load (s16), addrspace 4)
; GFX10: S_ENDPGM 0, implicit [[ZEXTLOAD]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_ZEXTLOAD %0 :: (invariant load (s16), align 2, addrspace 4)
S_ENDPGM 0, implicit %1
...
---
name: local_load_i8_align4
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: local_load_i8_align4
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX8: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p1) :: (load (s8), align 4, addrspace 3)
; GFX8: S_ENDPGM 0, implicit [[LOAD]](s32)
; GFX9-LABEL: name: local_load_i8_align4
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX9: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p1) :: (load (s8), align 4, addrspace 3)
; GFX9: S_ENDPGM 0, implicit [[LOAD]](s32)
; GFX10-LABEL: name: local_load_i8_align4
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX10: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p1) :: (load (s8), align 4, addrspace 3)
; GFX10: S_ENDPGM 0, implicit [[LOAD]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_LOAD %0 :: (load (s8), align 4, addrspace 3)
S_ENDPGM 0, implicit %1
...
---
name: private_load_i8_align4
legalized: true
body: |
bb.0:
liveins: $sgpr0_sgpr1
; GFX8-LABEL: name: private_load_i8_align4
; GFX8: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX8: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX8: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p1) :: (load (s8), align 4, addrspace 5)
; GFX8: S_ENDPGM 0, implicit [[LOAD]](s32)
; GFX9-LABEL: name: private_load_i8_align4
; GFX9: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX9: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX9: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p1) :: (load (s8), align 4, addrspace 5)
; GFX9: S_ENDPGM 0, implicit [[LOAD]](s32)
; GFX10-LABEL: name: private_load_i8_align4
; GFX10: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
; GFX10: [[COPY1:%[0-9]+]]:vgpr(p1) = COPY [[COPY]](p1)
; GFX10: [[LOAD:%[0-9]+]]:vgpr(s32) = G_LOAD [[COPY1]](p1) :: (load (s8), align 4, addrspace 5)
; GFX10: S_ENDPGM 0, implicit [[LOAD]](s32)
%0:_(p1) = COPY $sgpr0_sgpr1
%1:_(s32) = G_LOAD %0 :: (load (s8), align 4, addrspace 5)
S_ENDPGM 0, implicit %1
...