[InstCombine] Signed saturation patterns
[llvm-complete.git] / test / CodeGen / AMDGPU / si-lower-control-flow.mir
blobfdb0c465c20be9dbe02f4ef3afb5f0779d4ba752
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -run-pass=si-lower-control-flow -verify-machineinstrs %s -o - | FileCheck -check-prefixes=GCN %s
4 # Check that assert is not triggered
6 ...
7 ---
8 name: si-lower-control-flow
9 body: |
10   bb.0:
11     ; GCN-LABEL: name: si-lower-control-flow
12     ; GCN: [[COPY:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
13     ; GCN: [[S_LOAD_DWORD_IMM:%[0-9]+]]:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM [[COPY]], 16, 0
14     ; GCN: [[S_AND_B32_:%[0-9]+]]:sreg_32_xm0 = S_AND_B32 [[S_LOAD_DWORD_IMM]], 255, implicit-def $scc
15     ; GCN: [[S_AND_B32_1:%[0-9]+]]:sreg_32_xm0 = S_AND_B32 65535, [[S_AND_B32_]], implicit-def $scc
16     ; GCN: S_ENDPGM 0
17     %0:sgpr_64 = COPY $sgpr4_sgpr5
18     %1:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %0, 16, 0, 0
19     %2:sreg_32_xm0 = S_AND_B32 %1, 255, implicit-def $scc
20     %3:sreg_32_xm0 = S_AND_B32 65535, %2, implicit-def $scc
21     S_ENDPGM 0
22 ...
24 ---
25 name: preserve_undef_flag_si_if_src
26 tracksRegLiveness: true
27 body:             |
28   ; GCN-LABEL: name: preserve_undef_flag_si_if_src
29   ; GCN: bb.0:
30   ; GCN:   successors: %bb.1(0x40000000), %bb.2(0x40000000)
31   ; GCN:   [[COPY:%[0-9]+]]:sreg_64 = COPY $exec, implicit-def $exec
32   ; GCN:   [[S_AND_B64_:%[0-9]+]]:sreg_64 = S_AND_B64 [[COPY]], undef %1:sreg_64, implicit-def dead $scc
33   ; GCN:   [[S_XOR_B64_:%[0-9]+]]:sreg_64 = S_XOR_B64 [[S_AND_B64_]], [[COPY]], implicit-def dead $scc
34   ; GCN:   $exec = S_MOV_B64_term killed [[S_AND_B64_]]
35   ; GCN:   SI_MASK_BRANCH %bb.2, implicit $exec
36   ; GCN:   S_BRANCH %bb.1
37   ; GCN: bb.1:
38   ; GCN:   successors: %bb.2(0x80000000)
39   ; GCN: bb.2:
40   ; GCN:   S_ENDPGM 0
41   bb.0:
42     successors: %bb.1, %bb.2
44     %1:sreg_64 = SI_IF undef %0:sreg_64, %bb.2, implicit-def dead $exec, implicit-def dead $scc, implicit $exec
45     S_BRANCH %bb.1
47   bb.1:
48     successors: %bb.2
50   bb.2:
51     S_ENDPGM 0
53 ...