1 # REQUIRES: amdgpu-registered-target
2 # RUN: llvm-reduce -abort-on-invalid-reduction -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log
3 # RUN: FileCheck --match-full-lines --check-prefix=RESULT %s < %t
5 # Verify that reduction works with generic virtual registers, and the
6 # properties like register banks, types and names.
9 # CHECK-INTERESTINGNESS: G_IMPLICIT_DEF
10 # CHECK-INTERESTINGNESS: G_BITCAST
11 # CHECK-INTERESTINGNESS: S_NOP 0, implicit %unused_load_ptr
12 # CHECK-INTERESTINGNESS: G_ADD
13 # CHECK-INTERESTINGNESS: G_IMPLICIT_DEF
14 # CHECK-INTERESTINGNESS: G_STORE
15 # CHECK-INTERESTINGNESS: S_ENDPGM 0, implicit %add(s64), implicit %v1(<2 x s16>), implicit %{{[0-9]+}}(s64)
17 # RESULT: %{{[0-9]+}}:vgpr(s32) = G_IMPLICIT_DEF
18 # RESULT-NEXT: %{{[0-9]+}}:vreg_64(s64) = IMPLICIT_DEF
19 # RESULT-NEXT: %{{[0-9]+}}:_(<2 x s32>) = G_IMPLICIT_DEF
20 # RESULT-NEXT: %v1:vgpr(<2 x s16>) = G_IMPLICIT_DEF
21 # RESULT-NEXT: %unused_load_ptr:sgpr(p1) = G_IMPLICIT_DEF
22 # RESULT-NEXT: %aoeu:_(s64) = G_BITCAST %{{[0-9]+}}(<2 x s32>)
23 # RESULT-NEXT: S_NOP 0, implicit %unused_load_ptr(p1)
24 # RESULT-NEXT: %add:_(s64) = G_ADD %aoeu, %aoeu
25 # RESULT-NEXT: %ptr:_(p1) = G_IMPLICIT_DEF
26 # RESULT-NEXT: G_STORE %{{[0-9]+}}(s32), %ptr(p1) :: (store (s32), addrspace 1)
27 # RESULT-NEXT: S_ENDPGM 0, implicit %add(s64), implicit %v1(<2 x s16>), implicit %14(s64)
31 tracksRegLiveness: true
34 liveins: $vgpr0, $vgpr1, $vgpr2_vgpr3
35 %v0:vgpr(s32) = COPY $vgpr0
36 %v1:vgpr(<2 x s16>) = COPY $vgpr1
37 %unused_load_ptr:sgpr(p1) = G_IMPLICIT_DEF
38 %unused_load:_(s64) = G_LOAD %unused_load_ptr :: (load (s64), addrspace 1)
39 G_STORE %unused_load, %unused_load_ptr :: (store (s64), addrspace 1)
40 %2:vreg_64(s64) = COPY $vgpr2_vgpr3
41 %arst:_(<2 x s32>) = G_IMPLICIT_DEF
42 %aoeu:_(s64) = G_BITCAST %arst
43 S_NOP 0, implicit %unused_load_ptr
44 %add:_(s64) = G_ADD %aoeu, %aoeu
45 %ptr:_(p1) = G_IMPLICIT_DEF
46 G_STORE %v0, %ptr :: (store 4, addrspace 1)
47 S_ENDPGM 0, implicit %add, implicit %v1, implicit %2