[InstCombine] Signed saturation patterns
[llvm-complete.git] / test / CodeGen / AMDGPU / reduce-saveexec.mir
blobf6264476fff8630dcf502e6befe560c11a0e61a0
1 # RUN: llc -march=amdgcn -verify-machineinstrs -run-pass si-optimize-exec-masking %s -o - | FileCheck -check-prefix=GCN %s
3 ---
4 # GCN-LABEL: name: reduce_and_saveexec
5 # GCN:      $exec = S_AND_B64 $exec, killed $vcc
6 # GCN-NEXT: S_ENDPGM 0
7 name: reduce_and_saveexec
8 tracksRegLiveness: true
9 body:             |
10   bb.0:
11     $vcc = IMPLICIT_DEF
12     $sgpr0_sgpr1 = S_AND_B64 $exec, killed $vcc, implicit-def $scc
13     $exec = COPY killed $sgpr0_sgpr1
14     S_ENDPGM 0
15 ...
16 ---
17 # GCN-LABEL: name: reduce_and_saveexec_commuted
18 # GCN:      $exec = S_AND_B64 killed $vcc, $exec
19 # GCN-NEXT: S_ENDPGM 0
20 name: reduce_and_saveexec_commuted
21 tracksRegLiveness: true
22 body:             |
23   bb.0:
24     $vcc = IMPLICIT_DEF
25     $sgpr0_sgpr1 = S_AND_B64 killed $vcc, $exec, implicit-def $scc
26     $exec = COPY killed $sgpr0_sgpr1
27     S_ENDPGM 0
28 ...
29 ---
30 # GCN-LABEL: name: reduce_and_saveexec_liveout
31 # GCN:      $sgpr0_sgpr1 = S_AND_B64 $exec, killed $vcc
32 # GCN-NEXT: $exec = COPY
33 name: reduce_and_saveexec_liveout
34 tracksRegLiveness: true
35 body:             |
36   bb.0:
37     $vcc = IMPLICIT_DEF
38     $sgpr0_sgpr1 = S_AND_B64 $exec, killed $vcc, implicit-def $scc
39     $exec = COPY $sgpr0_sgpr1
40     S_ENDPGM 0
41 ...
42 ---
43 # GCN-LABEL: name: and_saveexec
44 # GCN:      $sgpr0_sgpr1 = S_AND_SAVEEXEC_B64 $vcc
45 # GCN-NEXT: S_ENDPGM 0
46 name: and_saveexec
47 tracksRegLiveness: true
48 body:             |
49   bb.0:
50     $vcc = IMPLICIT_DEF
51     $sgpr0_sgpr1 = COPY $exec
52     $sgpr2_sgpr3 = S_AND_B64 $sgpr0_sgpr1, killed $vcc, implicit-def $scc
53     $exec = S_MOV_B64_term $sgpr2_sgpr3
54     S_ENDPGM 0
55 ...
56 ---
57 # GCN-LABEL: name: reduce_or_saveexec
58 # GCN:      $exec = S_OR_B64 $exec, killed $vcc
59 # GCN-NEXT: S_ENDPGM 0
60 name: reduce_or_saveexec
61 tracksRegLiveness: true
62 body:             |
63   bb.0:
64     $vcc = IMPLICIT_DEF
65     $sgpr0_sgpr1 = S_OR_B64 $exec, killed $vcc, implicit-def $scc
66     $exec = COPY killed $sgpr0_sgpr1
67     S_ENDPGM 0
68 ...
69 ---
70 # GCN-LABEL: name: reduce_xor_saveexec
71 # GCN:      $exec = S_XOR_B64 $exec, killed $vcc
72 # GCN-NEXT: S_ENDPGM 0
73 name: reduce_xor_saveexec
74 tracksRegLiveness: true
75 body:             |
76   bb.0:
77     $vcc = IMPLICIT_DEF
78     $sgpr0_sgpr1 = S_XOR_B64 $exec, killed $vcc, implicit-def $scc
79     $exec = COPY killed $sgpr0_sgpr1
80     S_ENDPGM 0
81 ...
82 ---
83 # GCN-LABEL: name: reduce_andn2_saveexec
84 # GCN:      $exec = S_ANDN2_B64 $exec, killed $vcc
85 # GCN-NEXT: S_ENDPGM 0
86 name: reduce_andn2_saveexec
87 tracksRegLiveness: true
88 body:             |
89   bb.0:
90     $vcc = IMPLICIT_DEF
91     $sgpr0_sgpr1 = S_ANDN2_B64 $exec, killed $vcc, implicit-def $scc
92     $exec = COPY killed $sgpr0_sgpr1
93     S_ENDPGM 0
94 ...
95 ---
96 # GCN-LABEL: name: reduce_orn2_saveexec
97 # GCN:      $exec = S_ORN2_B64 $exec, killed $vcc
98 # GCN-NEXT: S_ENDPGM 0
99 name: reduce_orn2_saveexec
100 tracksRegLiveness: true
101 body:             |
102   bb.0:
103     $vcc = IMPLICIT_DEF
104     $sgpr0_sgpr1 = S_ORN2_B64 $exec, killed $vcc, implicit-def $scc
105     $exec = COPY killed $sgpr0_sgpr1
106     S_ENDPGM 0
109 # GCN-LABEL: name: reduce_nand_saveexec
110 # GCN:      $exec = S_NAND_B64 $exec, killed $vcc
111 # GCN-NEXT: S_ENDPGM 0
112 name: reduce_nand_saveexec
113 tracksRegLiveness: true
114 body:             |
115   bb.0:
116     $vcc = IMPLICIT_DEF
117     $sgpr0_sgpr1 = S_NAND_B64 $exec, killed $vcc, implicit-def $scc
118     $exec = COPY killed $sgpr0_sgpr1
119     S_ENDPGM 0
122 # GCN-LABEL: name: reduce_nor_saveexec
123 # GCN:      $exec = S_NOR_B64 $exec, killed $vcc
124 # GCN-NEXT: S_ENDPGM 0
125 name: reduce_nor_saveexec
126 tracksRegLiveness: true
127 body:             |
128   bb.0:
129     $vcc = IMPLICIT_DEF
130     $sgpr0_sgpr1 = S_NOR_B64 $exec, killed $vcc, implicit-def $scc
131     $exec = COPY killed $sgpr0_sgpr1
132     S_ENDPGM 0
135 # GCN-LABEL: name: reduce_xnor_saveexec
136 # GCN:      $exec = S_XNOR_B64 $exec, killed $vcc
137 # GCN-NEXT: S_ENDPGM 0
138 name: reduce_xnor_saveexec
139 tracksRegLiveness: true
140 body:             |
141   bb.0:
142     $vcc = IMPLICIT_DEF
143     $sgpr0_sgpr1 = S_XNOR_B64 $exec, killed $vcc, implicit-def $scc
144     $exec = COPY killed $sgpr0_sgpr1
145     S_ENDPGM 0