1 # RUN: llc -march=amdgcn -verify-machineinstrs -run-pass si-optimize-exec-masking -o - %s | FileCheck %s
4 target datalayout = "e-p:32:32-p1:64:64-p2:64:64-p3:32:32-p4:64:64-p5:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64"
6 define amdgpu_kernel void @optimize_if_and_saveexec_xor(i32 %z, i32 %v) #0 {
8 %id = call i32 @llvm.amdgcn.workitem.id.x()
9 %cc = icmp eq i32 %id, 0
10 %0 = call { i1, i64 } @llvm.amdgcn.if(i1 %cc)
11 %1 = extractvalue { i1, i64 } %0, 0
12 %2 = extractvalue { i1, i64 } %0, 1
13 br i1 %1, label %if, label %end
15 if: ; preds = %main_body
16 %v.if = load volatile i32, i32 addrspace(1)* undef
19 end: ; preds = %if, %main_body
20 %r = phi i32 [ 4, %main_body ], [ %v.if, %if ]
21 call void @llvm.amdgcn.end.cf(i64 %2)
22 store i32 %r, i32 addrspace(1)* undef
26 define amdgpu_kernel void @optimize_if_and_saveexec(i32 %z, i32 %v) #0 {
28 br i1 undef, label %if, label %end
37 define amdgpu_kernel void @optimize_if_or_saveexec(i32 %z, i32 %v) #0 {
39 br i1 undef, label %if, label %end
49 define amdgpu_kernel void @optimize_if_and_saveexec_xor_valu_middle(i32 %z, i32 %v) #0 {
51 %id = call i32 @llvm.amdgcn.workitem.id.x()
52 %cc = icmp eq i32 %id, 0
53 %0 = call { i1, i64 } @llvm.amdgcn.if(i1 %cc)
54 %1 = extractvalue { i1, i64 } %0, 0
55 %2 = extractvalue { i1, i64 } %0, 1
56 store i32 %id, i32 addrspace(1)* undef
57 br i1 %1, label %if, label %end
59 if: ; preds = %main_body
60 %v.if = load volatile i32, i32 addrspace(1)* undef
63 end: ; preds = %if, %main_body
64 %r = phi i32 [ 4, %main_body ], [ %v.if, %if ]
65 call void @llvm.amdgcn.end.cf(i64 %2)
66 store i32 %r, i32 addrspace(1)* undef
70 define amdgpu_kernel void @optimize_if_and_saveexec_xor_wrong_reg(i32 %z, i32 %v) #0 {
72 br i1 undef, label %if, label %end
81 define amdgpu_kernel void @optimize_if_and_saveexec_xor_modify_copy_to_exec(i32 %z, i32 %v) #0 {
83 br i1 undef, label %if, label %end
92 define amdgpu_kernel void @optimize_if_and_saveexec_xor_live_out_setexec(i32 %z, i32 %v) #0 {
94 br i1 undef, label %if, label %end
103 define amdgpu_kernel void @optimize_if_unknown_saveexec(i32 %z, i32 %v) #0 {
105 br i1 undef, label %if, label %end
114 define amdgpu_kernel void @optimize_if_andn2_saveexec(i32 %z, i32 %v) #0 {
116 br i1 undef, label %if, label %end
125 define amdgpu_kernel void @optimize_if_andn2_saveexec_no_commute(i32 %z, i32 %v) #0 {
127 br i1 undef, label %if, label %end
136 ; Function Attrs: nounwind readnone
137 declare i32 @llvm.amdgcn.workitem.id.x() #1
139 declare { i1, i64 } @llvm.amdgcn.if(i1)
141 declare void @llvm.amdgcn.end.cf(i64)
144 attributes #0 = { nounwind }
145 attributes #1 = { nounwind readnone }
149 # CHECK-LABEL: name: optimize_if_and_saveexec_xor{{$}}
150 # CHECK: $sgpr0_sgpr1 = S_AND_SAVEEXEC_B64 $vcc, implicit-def $exec, implicit-def $scc, implicit $exec
151 # CHECK-NEXT: $sgpr0_sgpr1 = S_XOR_B64 $exec, killed $sgpr0_sgpr1, implicit-def $scc
152 # CHECK-NEXT: SI_MASK_BRANCH
154 name: optimize_if_and_saveexec_xor
156 exposesReturnsTwice: false
158 regBankSelected: false
160 tracksRegLiveness: true
164 isFrameAddressTaken: false
165 isReturnAddressTaken: false
174 hasOpaqueSPAdjustment: false
176 hasMustTailInVarArgFunc: false
181 $sgpr0_sgpr1 = COPY $exec
182 $vcc = V_CMP_EQ_I32_e64 0, killed $vgpr0, implicit $exec
183 $vgpr0 = V_MOV_B32_e32 4, implicit $exec
184 $sgpr2_sgpr3 = S_AND_B64 $sgpr0_sgpr1, killed $vcc, implicit-def $scc
185 $sgpr0_sgpr1 = S_XOR_B64 $sgpr2_sgpr3, killed $sgpr0_sgpr1, implicit-def $scc
186 $exec = S_MOV_B64_term killed $sgpr2_sgpr3
187 SI_MASK_BRANCH %bb.2, implicit $exec
191 liveins: $sgpr0_sgpr1
193 $sgpr7 = S_MOV_B32 61440
194 $sgpr6 = S_MOV_B32 -1
195 $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit $exec :: (volatile load 4 from `i32 addrspace(1)* undef`)
198 liveins: $vgpr0, $sgpr0_sgpr1
200 $exec = S_OR_B64 $exec, killed $sgpr0_sgpr1, implicit-def $scc
201 $sgpr3 = S_MOV_B32 61440
202 $sgpr2 = S_MOV_B32 -1
203 BUFFER_STORE_DWORD_OFFSET killed $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into `i32 addrspace(1)* undef`)
208 # CHECK-LABEL: name: optimize_if_and_saveexec{{$}}
209 # CHECK: $sgpr0_sgpr1 = S_AND_SAVEEXEC_B64 $vcc, implicit-def $exec, implicit-def $scc, implicit $exec
210 # CHECK-NEXT: SI_MASK_BRANCH
212 name: optimize_if_and_saveexec
214 exposesReturnsTwice: false
216 regBankSelected: false
218 tracksRegLiveness: true
222 isFrameAddressTaken: false
223 isReturnAddressTaken: false
232 hasOpaqueSPAdjustment: false
234 hasMustTailInVarArgFunc: false
239 $sgpr0_sgpr1 = COPY $exec
240 $vcc = V_CMP_EQ_I32_e64 0, killed $vgpr0, implicit $exec
241 $vgpr0 = V_MOV_B32_e32 4, implicit $exec
242 $sgpr2_sgpr3 = S_AND_B64 $sgpr0_sgpr1, killed $vcc, implicit-def $scc
243 $exec = S_MOV_B64_term killed $sgpr2_sgpr3
244 SI_MASK_BRANCH %bb.2, implicit $exec
248 liveins: $sgpr0_sgpr1
250 $sgpr7 = S_MOV_B32 61440
251 $sgpr6 = S_MOV_B32 -1
252 $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit $exec :: (volatile load 4 from `i32 addrspace(1)* undef`)
255 liveins: $vgpr0, $sgpr0_sgpr1
257 $exec = S_OR_B64 $exec, killed $sgpr0_sgpr1, implicit-def $scc
258 $sgpr3 = S_MOV_B32 61440
259 $sgpr2 = S_MOV_B32 -1
260 BUFFER_STORE_DWORD_OFFSET killed $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into `i32 addrspace(1)* undef`)
265 # CHECK-LABEL: name: optimize_if_or_saveexec{{$}}
266 # CHECK: $sgpr0_sgpr1 = S_OR_SAVEEXEC_B64 $vcc, implicit-def $exec, implicit-def $scc, implicit $exec
267 # CHECK-NEXT: SI_MASK_BRANCH
269 name: optimize_if_or_saveexec
271 exposesReturnsTwice: false
273 regBankSelected: false
275 tracksRegLiveness: true
279 isFrameAddressTaken: false
280 isReturnAddressTaken: false
289 hasOpaqueSPAdjustment: false
291 hasMustTailInVarArgFunc: false
296 $sgpr0_sgpr1 = COPY $exec
297 $vcc = V_CMP_EQ_I32_e64 0, killed $vgpr0, implicit $exec
298 $vgpr0 = V_MOV_B32_e32 4, implicit $exec
299 $sgpr2_sgpr3 = S_OR_B64 $sgpr0_sgpr1, killed $vcc, implicit-def $scc
300 $exec = S_MOV_B64_term killed $sgpr2_sgpr3
301 SI_MASK_BRANCH %bb.2, implicit $exec
305 liveins: $sgpr0_sgpr1
307 $sgpr7 = S_MOV_B32 61440
308 $sgpr6 = S_MOV_B32 -1
309 $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit $exec :: (volatile load 4 from `i32 addrspace(1)* undef`)
312 liveins: $vgpr0, $sgpr0_sgpr1
314 $exec = S_OR_B64 $exec, killed $sgpr0_sgpr1, implicit-def $scc
315 $sgpr3 = S_MOV_B32 61440
316 $sgpr2 = S_MOV_B32 -1
317 BUFFER_STORE_DWORD_OFFSET killed $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into `i32 addrspace(1)* undef`)
322 # CHECK-LABEL: name: optimize_if_and_saveexec_xor_valu_middle
323 # CHECK: $sgpr2_sgpr3 = S_AND_B64 $sgpr0_sgpr1, killed $vcc, implicit-def $scc
324 # CHECK-NEXT: BUFFER_STORE_DWORD_OFFSET $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into `i32 addrspace(1)* undef`, addrspace 1)
325 # CHECK-NEXT: $sgpr0_sgpr1 = S_XOR_B64 $sgpr2_sgpr3, killed $sgpr0_sgpr1, implicit-def $scc
326 # CHECK-NEXT: $exec = COPY killed $sgpr2_sgpr3
327 # CHECK-NEXT: SI_MASK_BRANCH
328 name: optimize_if_and_saveexec_xor_valu_middle
330 exposesReturnsTwice: false
332 regBankSelected: false
334 tracksRegLiveness: true
338 isFrameAddressTaken: false
339 isReturnAddressTaken: false
348 hasOpaqueSPAdjustment: false
350 hasMustTailInVarArgFunc: false
355 $sgpr0_sgpr1 = COPY $exec
356 $vcc = V_CMP_EQ_I32_e64 0, killed $vgpr0, implicit $exec
357 $vgpr0 = V_MOV_B32_e32 4, implicit $exec
358 $sgpr2_sgpr3 = S_AND_B64 $sgpr0_sgpr1, killed $vcc, implicit-def $scc
359 BUFFER_STORE_DWORD_OFFSET $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into `i32 addrspace(1)* undef`)
360 $sgpr0_sgpr1 = S_XOR_B64 $sgpr2_sgpr3, killed $sgpr0_sgpr1, implicit-def $scc
361 $exec = S_MOV_B64_term killed $sgpr2_sgpr3
362 SI_MASK_BRANCH %bb.2, implicit $exec
366 liveins: $sgpr0_sgpr1
368 $sgpr7 = S_MOV_B32 61440
369 $sgpr6 = S_MOV_B32 -1
370 $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit $exec :: (volatile load 4 from `i32 addrspace(1)* undef`)
373 liveins: $vgpr0, $sgpr0_sgpr1
375 $exec = S_OR_B64 $exec, killed $sgpr0_sgpr1, implicit-def $scc
376 $sgpr3 = S_MOV_B32 61440
377 $sgpr2 = S_MOV_B32 -1
378 BUFFER_STORE_DWORD_OFFSET killed $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into `i32 addrspace(1)* undef`)
383 # CHECK-LABEL: name: optimize_if_and_saveexec_xor_wrong_reg{{$}}
384 # CHECK: $sgpr0_sgpr1 = S_AND_B64 $sgpr0_sgpr1, killed $vcc, implicit-def $scc
385 # CHECK-NEXT: $sgpr0_sgpr1 = S_XOR_B64 undef $sgpr2_sgpr3, killed $sgpr0_sgpr1, implicit-def $scc
386 # CHECK-NEXT: $exec = COPY $sgpr0_sgpr1
387 # CHECK-NEXT: SI_MASK_BRANCH %bb.2, implicit $exec
388 name: optimize_if_and_saveexec_xor_wrong_reg
390 exposesReturnsTwice: false
392 regBankSelected: false
394 tracksRegLiveness: true
398 isFrameAddressTaken: false
399 isReturnAddressTaken: false
408 hasOpaqueSPAdjustment: false
410 hasMustTailInVarArgFunc: false
415 $sgpr6 = S_MOV_B32 -1
416 $sgpr7 = S_MOV_B32 61440
417 $sgpr0_sgpr1 = COPY $exec
418 $vcc = V_CMP_EQ_I32_e64 0, killed $vgpr0, implicit $exec
419 $vgpr0 = V_MOV_B32_e32 4, implicit $exec
420 $sgpr0_sgpr1 = S_AND_B64 $sgpr0_sgpr1, killed $vcc, implicit-def $scc
421 $sgpr0_sgpr1 = S_XOR_B64 undef $sgpr2_sgpr3, killed $sgpr0_sgpr1, implicit-def $scc
422 $exec = S_MOV_B64_term $sgpr0_sgpr1
423 SI_MASK_BRANCH %bb.2, implicit $exec
427 liveins: $sgpr0_sgpr1 , $sgpr4_sgpr5_sgpr6_sgpr7
428 $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit $exec :: (volatile load 4 from `i32 addrspace(1)* undef`)
431 liveins: $vgpr0, $sgpr0_sgpr1, $sgpr4_sgpr5_sgpr6_sgpr7
433 $exec = S_OR_B64 $exec, killed $sgpr0_sgpr1, implicit-def $scc
434 $sgpr3 = S_MOV_B32 61440
435 $sgpr2 = S_MOV_B32 -1
436 BUFFER_STORE_DWORD_OFFSET killed $vgpr0, $sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into `i32 addrspace(1)* undef`)
441 # CHECK-LABEL: name: optimize_if_and_saveexec_xor_modify_copy_to_exec{{$}}
442 # CHECK: $sgpr2_sgpr3 = S_AND_B64 $sgpr0_sgpr1, killed $vcc, implicit-def $scc
443 # CHECK-NEXT: $sgpr2_sgpr3 = S_OR_B64 killed $sgpr2_sgpr3, 1, implicit-def $scc
444 # CHECK-NEXT: $sgpr0_sgpr1 = S_XOR_B64 $sgpr2_sgpr3, killed $sgpr0_sgpr1, implicit-def $scc
445 # CHECK-NEXT: $exec = COPY killed $sgpr2_sgpr3
446 # CHECK-NEXT: SI_MASK_BRANCH %bb.2, implicit $exec
448 name: optimize_if_and_saveexec_xor_modify_copy_to_exec
450 exposesReturnsTwice: false
452 regBankSelected: false
454 tracksRegLiveness: true
458 isFrameAddressTaken: false
459 isReturnAddressTaken: false
468 hasOpaqueSPAdjustment: false
470 hasMustTailInVarArgFunc: false
475 $sgpr0_sgpr1 = COPY $exec
476 $vcc = V_CMP_EQ_I32_e64 0, killed $vgpr0, implicit $exec
477 $vgpr0 = V_MOV_B32_e32 4, implicit $exec
478 $sgpr2_sgpr3 = S_AND_B64 $sgpr0_sgpr1, killed $vcc, implicit-def $scc
479 $sgpr2_sgpr3 = S_OR_B64 killed $sgpr2_sgpr3, 1, implicit-def $scc
480 $sgpr0_sgpr1 = S_XOR_B64 $sgpr2_sgpr3, killed $sgpr0_sgpr1, implicit-def $scc
481 $exec = S_MOV_B64_term killed $sgpr2_sgpr3
482 SI_MASK_BRANCH %bb.2, implicit $exec
486 liveins: $sgpr0_sgpr1
488 $sgpr7 = S_MOV_B32 61440
489 $sgpr6 = S_MOV_B32 -1
490 $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit $exec :: (volatile load 4 from `i32 addrspace(1)* undef`)
493 liveins: $vgpr0, $sgpr0_sgpr1
495 $exec = S_OR_B64 $exec, killed $sgpr0_sgpr1, implicit-def $scc
498 $sgpr2 = S_MOV_B32 -1
499 $sgpr3 = S_MOV_B32 61440
500 BUFFER_STORE_DWORD_OFFSET killed $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into `i32 addrspace(1)* undef`)
505 # CHECK-LABEL: name: optimize_if_and_saveexec_xor_live_out_setexec{{$}}
506 # CHECK: $sgpr2_sgpr3 = S_AND_B64 $sgpr0_sgpr1, killed $vcc, implicit-def $scc
507 # CHECK-NEXT: $sgpr0_sgpr1 = S_XOR_B64 $sgpr2_sgpr3, killed $sgpr0_sgpr1, implicit-def $scc
508 # CHECK-NEXT: $exec = COPY $sgpr2_sgpr3
509 # CHECK-NEXT: SI_MASK_BRANCH
510 name: optimize_if_and_saveexec_xor_live_out_setexec
512 exposesReturnsTwice: false
514 regBankSelected: false
516 tracksRegLiveness: true
520 isFrameAddressTaken: false
521 isReturnAddressTaken: false
530 hasOpaqueSPAdjustment: false
532 hasMustTailInVarArgFunc: false
537 $sgpr0_sgpr1 = COPY $exec
538 $vcc = V_CMP_EQ_I32_e64 0, killed $vgpr0, implicit $exec
539 $vgpr0 = V_MOV_B32_e32 4, implicit $exec
540 $sgpr2_sgpr3 = S_AND_B64 $sgpr0_sgpr1, killed $vcc, implicit-def $scc
541 $sgpr0_sgpr1 = S_XOR_B64 $sgpr2_sgpr3, killed $sgpr0_sgpr1, implicit-def $scc
542 $exec = S_MOV_B64_term $sgpr2_sgpr3
543 SI_MASK_BRANCH %bb.2, implicit $exec
547 liveins: $sgpr0_sgpr1, $sgpr2_sgpr3
548 S_SLEEP 0, implicit $sgpr2_sgpr3
549 $sgpr7 = S_MOV_B32 61440
550 $sgpr6 = S_MOV_B32 -1
551 $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit $exec :: (volatile load 4 from `i32 addrspace(1)* undef`)
554 liveins: $vgpr0, $sgpr0_sgpr1
556 $exec = S_OR_B64 $exec, killed $sgpr0_sgpr1, implicit-def $scc
557 $sgpr3 = S_MOV_B32 61440
558 $sgpr2 = S_MOV_B32 -1
559 BUFFER_STORE_DWORD_OFFSET killed $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into `i32 addrspace(1)* undef`)
564 # CHECK-LABEL: name: optimize_if_unknown_saveexec{{$}}
565 # CHECK: $sgpr0_sgpr1 = COPY $exec
566 # CHECK: $sgpr2_sgpr3 = S_LSHR_B64 $sgpr0_sgpr1, killed $vcc_lo, implicit-def $scc
567 # CHECK-NEXT: $exec = COPY killed $sgpr2_sgpr3
568 # CHECK-NEXT: SI_MASK_BRANCH %bb.2, implicit $exec
570 name: optimize_if_unknown_saveexec
572 exposesReturnsTwice: false
574 regBankSelected: false
576 tracksRegLiveness: true
580 isFrameAddressTaken: false
581 isReturnAddressTaken: false
590 hasOpaqueSPAdjustment: false
592 hasMustTailInVarArgFunc: false
597 $sgpr0_sgpr1 = COPY $exec
598 $vcc = V_CMP_EQ_I32_e64 0, killed $vgpr0, implicit $exec
599 $vgpr0 = V_MOV_B32_e32 4, implicit $exec
600 $sgpr2_sgpr3 = S_LSHR_B64 $sgpr0_sgpr1, killed $vcc_lo, implicit-def $scc
601 $exec = S_MOV_B64_term killed $sgpr2_sgpr3
602 SI_MASK_BRANCH %bb.2, implicit $exec
606 liveins: $sgpr0_sgpr1
608 $sgpr7 = S_MOV_B32 61440
609 $sgpr6 = S_MOV_B32 -1
610 $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit $exec :: (volatile load 4 from `i32 addrspace(1)* undef`)
613 liveins: $vgpr0, $sgpr0_sgpr1
615 $exec = S_OR_B64 $exec, killed $sgpr0_sgpr1, implicit-def $scc
616 $sgpr3 = S_MOV_B32 61440
617 $sgpr2 = S_MOV_B32 -1
618 BUFFER_STORE_DWORD_OFFSET killed $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into `i32 addrspace(1)* undef`)
623 # CHECK-LABEL: name: optimize_if_andn2_saveexec{{$}}
624 # CHECK: $sgpr0_sgpr1 = S_ANDN2_SAVEEXEC_B64 $vcc, implicit-def $exec, implicit-def $scc, implicit $exec
625 # CHECK-NEXT: SI_MASK_BRANCH
627 name: optimize_if_andn2_saveexec
629 exposesReturnsTwice: false
631 regBankSelected: false
633 tracksRegLiveness: true
637 isFrameAddressTaken: false
638 isReturnAddressTaken: false
647 hasOpaqueSPAdjustment: false
649 hasMustTailInVarArgFunc: false
654 $sgpr0_sgpr1 = COPY $exec
655 $vcc = V_CMP_EQ_I32_e64 0, killed $vgpr0, implicit $exec
656 $vgpr0 = V_MOV_B32_e32 4, implicit $exec
657 $sgpr2_sgpr3 = S_ANDN2_B64 $sgpr0_sgpr1, killed $vcc, implicit-def $scc
658 $exec = S_MOV_B64_term killed $sgpr2_sgpr3
659 SI_MASK_BRANCH %bb.2, implicit $exec
663 liveins: $sgpr0_sgpr1
665 $sgpr7 = S_MOV_B32 61440
666 $sgpr6 = S_MOV_B32 -1
667 $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit $exec :: (volatile load 4 from `i32 addrspace(1)* undef`)
670 liveins: $vgpr0, $sgpr0_sgpr1
672 $exec = S_OR_B64 $exec, killed $sgpr0_sgpr1, implicit-def $scc
673 $sgpr3 = S_MOV_B32 61440
674 $sgpr2 = S_MOV_B32 -1
675 BUFFER_STORE_DWORD_OFFSET killed $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into `i32 addrspace(1)* undef`)
680 # CHECK-LABEL: name: optimize_if_andn2_saveexec_no_commute{{$}}
681 # CHECK: $sgpr2_sgpr3 = S_ANDN2_B64 killed $vcc, $sgpr0_sgpr1, implicit-def $scc
682 # CHECK-NEXT: $exec = COPY killed $sgpr2_sgpr3
683 # CHECK-NEXT: SI_MASK_BRANCH %bb.2, implicit $exec
684 name: optimize_if_andn2_saveexec_no_commute
686 exposesReturnsTwice: false
688 regBankSelected: false
690 tracksRegLiveness: true
694 isFrameAddressTaken: false
695 isReturnAddressTaken: false
704 hasOpaqueSPAdjustment: false
706 hasMustTailInVarArgFunc: false
711 $sgpr0_sgpr1 = COPY $exec
712 $vcc = V_CMP_EQ_I32_e64 0, killed $vgpr0, implicit $exec
713 $vgpr0 = V_MOV_B32_e32 4, implicit $exec
714 $sgpr2_sgpr3 = S_ANDN2_B64 killed $vcc, $sgpr0_sgpr1, implicit-def $scc
715 $exec = S_MOV_B64_term killed $sgpr2_sgpr3
716 SI_MASK_BRANCH %bb.2, implicit $exec
720 liveins: $sgpr0_sgpr1
722 $sgpr7 = S_MOV_B32 61440
723 $sgpr6 = S_MOV_B32 -1
724 $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr4_sgpr5_sgpr6_sgpr7, 0, 0, 0, 0, 0, implicit $exec :: (volatile load 4 from `i32 addrspace(1)* undef`)
727 liveins: $vgpr0, $sgpr0_sgpr1
729 $exec = S_OR_B64 $exec, killed $sgpr0_sgpr1, implicit-def $scc
730 $sgpr3 = S_MOV_B32 61440
731 $sgpr2 = S_MOV_B32 -1
732 BUFFER_STORE_DWORD_OFFSET killed $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into `i32 addrspace(1)* undef`)