1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -run-pass=amdgpu-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s
5 name: sext_inreg_i32_8_and_neg255
7 tracksRegLiveness: true
12 ; CHECK-LABEL: name: sext_inreg_i32_8_and_neg255
13 ; CHECK: liveins: $vgpr0_vgpr1
15 ; CHECK-NEXT: %ptr:_(p1) = COPY $vgpr0_vgpr1
16 ; CHECK-NEXT: %load:_(s32) = G_LOAD %ptr(p1) :: (volatile load (s32), addrspace 1)
17 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
18 ; CHECK-NEXT: %inreg:_(s32) = G_AND %load, [[C]]
19 ; CHECK-NEXT: $vgpr0 = COPY %inreg(s32)
20 %ptr:_(p1) = COPY $vgpr0_vgpr1
21 %load:_(s32) = G_LOAD %ptr :: (volatile load (s32), addrspace 1, align 4)
22 %mask:_(s32) = G_CONSTANT i32 -255
23 %and:_(s32) = G_AND %load, %mask
24 %inreg:_(s32) = G_SEXT_INREG %and, 8
30 name: sext_inreg_i32_8_and_255
32 tracksRegLiveness: true
37 ; CHECK-LABEL: name: sext_inreg_i32_8_and_255
38 ; CHECK: liveins: $vgpr0_vgpr1
40 ; CHECK-NEXT: %ptr:_(p1) = COPY $vgpr0_vgpr1
41 ; CHECK-NEXT: %load:_(s32) = G_LOAD %ptr(p1) :: (volatile load (s32), addrspace 1)
42 ; CHECK-NEXT: %mask:_(s32) = G_CONSTANT i32 255
43 ; CHECK-NEXT: %and:_(s32) = G_AND %load, %mask
44 ; CHECK-NEXT: %inreg:_(s32) = G_SEXT_INREG %and, 8
45 ; CHECK-NEXT: $vgpr0 = COPY %inreg(s32)
46 %ptr:_(p1) = COPY $vgpr0_vgpr1
47 %load:_(s32) = G_LOAD %ptr :: (volatile load (s32), addrspace 1, align 4)
48 %mask:_(s32) = G_CONSTANT i32 255
49 %and:_(s32) = G_AND %load, %mask
50 %inreg:_(s32) = G_SEXT_INREG %and, 8
56 name: sext_inreg_v2i32_8_and_neg255
58 tracksRegLiveness: true
63 ; CHECK-LABEL: name: sext_inreg_v2i32_8_and_neg255
64 ; CHECK: liveins: $vgpr0_vgpr1
66 ; CHECK-NEXT: %ptr:_(p1) = COPY $vgpr0_vgpr1
67 ; CHECK-NEXT: %load:_(<2 x s32>) = G_LOAD %ptr(p1) :: (volatile load (<2 x s32>), addrspace 1)
68 ; CHECK-NEXT: %mask_elt:_(s32) = G_CONSTANT i32 -255
69 ; CHECK-NEXT: %mask:_(<2 x s32>) = G_BUILD_VECTOR %mask_elt(s32), %mask_elt(s32)
70 ; CHECK-NEXT: %and:_(<2 x s32>) = G_AND %load, %mask
71 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
72 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32)
73 ; CHECK-NEXT: %inreg:_(<2 x s32>) = G_AND %and, [[BUILD_VECTOR]]
74 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY %inreg(<2 x s32>)
75 %ptr:_(p1) = COPY $vgpr0_vgpr1
76 %load:_(<2 x s32>) = G_LOAD %ptr :: (volatile load (<2 x s32>), addrspace 1, align 8)
77 %mask_elt:_(s32) = G_CONSTANT i32 -255
78 %mask:_(<2 x s32>) = G_BUILD_VECTOR %mask_elt, %mask_elt
79 %and:_(<2 x s32>) = G_AND %load, %mask
80 %inreg:_(<2 x s32>) = G_SEXT_INREG %and, 8
81 $vgpr0_vgpr1 = COPY %inreg
86 name: sext_inreg_v2i32_8_and_255
88 tracksRegLiveness: true
93 ; CHECK-LABEL: name: sext_inreg_v2i32_8_and_255
94 ; CHECK: liveins: $vgpr0_vgpr1
96 ; CHECK-NEXT: %ptr:_(p1) = COPY $vgpr0_vgpr1
97 ; CHECK-NEXT: %load:_(<2 x s32>) = G_LOAD %ptr(p1) :: (volatile load (<2 x s32>), addrspace 1)
98 ; CHECK-NEXT: %mask_elt:_(s32) = G_CONSTANT i32 255
99 ; CHECK-NEXT: %mask:_(<2 x s32>) = G_BUILD_VECTOR %mask_elt(s32), %mask_elt(s32)
100 ; CHECK-NEXT: %and:_(<2 x s32>) = G_AND %load, %mask
101 ; CHECK-NEXT: %inreg:_(<2 x s32>) = G_SEXT_INREG %and, 8
102 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY %inreg(<2 x s32>)
103 %ptr:_(p1) = COPY $vgpr0_vgpr1
104 %load:_(<2 x s32>) = G_LOAD %ptr :: (volatile load (<2 x s32>), addrspace 1, align 8)
105 %mask_elt:_(s32) = G_CONSTANT i32 255
106 %mask:_(<2 x s32>) = G_BUILD_VECTOR %mask_elt, %mask_elt
107 %and:_(<2 x s32>) = G_AND %load, %mask
108 %inreg:_(<2 x s32>) = G_SEXT_INREG %and, 8
109 $vgpr0_vgpr1 = COPY %inreg