2018-03-17 23:17:41 +08:00
|
|
|
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
2018-05-06 05:19:59 +08:00
|
|
|
# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -O0 -run-pass=legalizer %s -o - | FileCheck %s
|
2018-03-17 23:17:41 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
name: test_store_global_i32
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0_vgpr1, $vgpr2
|
|
|
|
|
|
|
|
; CHECK-LABEL: name: test_store_global_i32
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
|
|
|
|
; CHECK: G_STORE [[COPY1]](s32), [[COPY]](p1) :: (store 4, addrspace 1)
|
|
|
|
%0:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
%1:_(s32) = COPY $vgpr2
|
|
|
|
G_STORE %1, %0 :: (store 4, addrspace 1)
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: test_store_global_i64
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
|
|
|
|
|
|
|
|
; CHECK-LABEL: name: test_store_global_i64
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
|
|
|
|
; CHECK: G_STORE [[COPY1]](s64), [[COPY]](p1) :: (store 8, addrspace 1)
|
|
|
|
%0:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
%1:_(s64) = COPY $vgpr2_vgpr3
|
|
|
|
G_STORE %1, %0 :: (store 8, addrspace 1)
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: test_store_global_p1
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
|
|
|
|
|
|
|
|
; CHECK-LABEL: name: test_store_global_p1
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:_(p1) = COPY $vgpr2_vgpr3
|
|
|
|
; CHECK: G_STORE [[COPY1]](p1), [[COPY]](p1) :: (store 8, addrspace 1)
|
|
|
|
%0:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
%1:_(p1) = COPY $vgpr2_vgpr3
|
|
|
|
G_STORE %1, %0 :: (store 8, addrspace 1)
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: test_store_global_p4
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
|
|
|
|
|
|
|
|
; CHECK-LABEL: name: test_store_global_p4
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:_(p4) = COPY $vgpr2_vgpr3
|
|
|
|
; CHECK: G_STORE [[COPY1]](p4), [[COPY]](p1) :: (store 8, addrspace 1)
|
|
|
|
%0:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
%1:_(p4) = COPY $vgpr2_vgpr3
|
|
|
|
G_STORE %1, %0 :: (store 8, addrspace 1)
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: test_store_global_p3
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0_vgpr1, $vgpr2
|
|
|
|
|
|
|
|
; CHECK-LABEL: name: test_store_global_p3
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:_(p3) = COPY $vgpr2
|
|
|
|
; CHECK: G_STORE [[COPY1]](p3), [[COPY]](p1) :: (store 4, addrspace 1)
|
|
|
|
%0:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
%1:_(p3) = COPY $vgpr2
|
|
|
|
G_STORE %1, %0 :: (store 4, addrspace 1)
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: test_store_global_v2s32
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
|
|
|
|
|
|
|
|
; CHECK-LABEL: name: test_store_global_v2s32
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
|
|
|
|
; CHECK: G_STORE [[COPY1]](<2 x s32>), [[COPY]](p1) :: (store 8, addrspace 1)
|
|
|
|
%0:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
%1:_(<2 x s32>) = COPY $vgpr2_vgpr3
|
|
|
|
G_STORE %1, %0 :: (store 8, addrspace 1)
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: test_store_global_v2s16
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0_vgpr1, $vgpr2
|
|
|
|
|
|
|
|
; CHECK-LABEL: name: test_store_global_v2s16
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr2
|
|
|
|
; CHECK: G_STORE [[COPY1]](<2 x s16>), [[COPY]](p1) :: (store 4, addrspace 1)
|
|
|
|
%0:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
%1:_(<2 x s16>) = COPY $vgpr2
|
|
|
|
G_STORE %1, %0 :: (store 4, addrspace 1)
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: test_store_global_v3s32
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
|
|
|
|
|
|
|
|
; CHECK-LABEL: name: test_store_global_v3s32
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
|
|
|
|
; CHECK: G_STORE [[COPY1]](<3 x s32>), [[COPY]](p1) :: (store 12, align 4, addrspace 1)
|
|
|
|
%0:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
%1:_(<3 x s32>) = COPY $vgpr2_vgpr3_vgpr4
|
|
|
|
G_STORE %1, %0 :: (store 12, align 4, addrspace 1)
|
|
|
|
...
|
2019-01-30 02:13:02 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
name: test_truncstore_global_s64_to_s8
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
|
|
|
|
|
|
|
|
; CHECK-LABEL: name: test_truncstore_global_s64_to_s8
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
|
|
|
|
; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
|
|
|
|
; CHECK: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
|
|
|
|
%0:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
%1:_(s64) = COPY $vgpr2_vgpr3
|
|
|
|
G_STORE %1, %0 :: (store 1, addrspace 1)
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: test_truncstore_global_s64_to_s16
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
|
|
|
|
|
|
|
|
; CHECK-LABEL: name: test_truncstore_global_s64_to_s16
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
|
|
|
|
; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
|
|
|
|
; CHECK: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
|
|
|
|
%0:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
%1:_(s64) = COPY $vgpr2_vgpr3
|
|
|
|
G_STORE %1, %0 :: (store 1, addrspace 1)
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: test_truncstore_global_s64_to_s32
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
|
|
|
|
|
|
|
|
; CHECK-LABEL: name: test_truncstore_global_s64_to_s32
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
|
|
|
|
; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
|
|
|
|
; CHECK: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store 4, addrspace 1)
|
|
|
|
%0:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
%1:_(s64) = COPY $vgpr2_vgpr3
|
|
|
|
G_STORE %1, %0 :: (store 4, addrspace 1)
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: test_truncstore_global_s128_to_s16
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4_vgpr5
|
|
|
|
|
|
|
|
; CHECK-LABEL: name: test_truncstore_global_s128_to_s16
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
|
|
|
|
; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s128)
|
|
|
|
; CHECK: G_STORE [[TRUNC]](s32), [[COPY]](p1) :: (store 1, addrspace 1)
|
|
|
|
%0:_(p1) = COPY $vgpr0_vgpr1
|
|
|
|
%1:_(s128) = COPY $vgpr2_vgpr3_vgpr4_vgpr5
|
|
|
|
G_STORE %1, %0 :: (store 1, addrspace 1)
|
|
|
|
...
|