llvm/llvm/test/CodeGen/AMDGPU/sink-after-control-flow-postra.mir

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -verify-machineinstrs -run-pass=postra-machine-sink -mattr=+wavefrontsize64 -o - %s | FileCheck -check-prefixes=GFX10 %s

# Ensure that PostRA Machine Sink does not sink instructions
# past block prologues which would overwrite their uses.

---
# Make sure COPY to $sgpr9 is not sunk after S_AND_SAVEEXEC_B64.
name:            _amdgpu_ps_main
alignment:       1
tracksRegLiveness: true
registers:       []
liveins:
  - { reg: '$sgpr4', virtual-reg: '' }
body:             |
  ; GFX10-LABEL: name: _amdgpu_ps_main
  ; GFX10: bb.0:
  ; GFX10-NEXT:   successors: %bb.1(0x80000000)
  ; GFX10-NEXT:   liveins: $sgpr4
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   renamable $sgpr9 = COPY $sgpr4
  ; GFX10-NEXT:   renamable $vgpr5 = IMPLICIT_DEF
  ; GFX10-NEXT:   renamable $sgpr0_sgpr1 = nofpexcept V_CMP_NGT_F32_e64 0, 0, 0, $vgpr5, 0, implicit $mode, implicit $exec
  ; GFX10-NEXT:   S_BRANCH %bb.1
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.1:
  ; GFX10-NEXT:   successors: %bb.2(0x40000000), %bb.3(0x40000000)
  ; GFX10-NEXT:   liveins: $sgpr6, $sgpr9, $sgpr0_sgpr1
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   $sgpr4_sgpr5 = S_AND_SAVEEXEC_B64 $sgpr0_sgpr1, implicit-def $exec, implicit-def $scc, implicit $exec
  ; GFX10-NEXT:   renamable $sgpr14_sgpr15 = S_XOR_B64 $exec, killed renamable $sgpr4_sgpr5, implicit-def dead $scc
  ; GFX10-NEXT:   S_CBRANCH_EXECZ %bb.3, implicit $exec
  ; GFX10-NEXT:   S_BRANCH %bb.2
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.2:
  ; GFX10-NEXT:   successors: %bb.3(0x80000000)
  ; GFX10-NEXT:   liveins: $sgpr6
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   $m0 = COPY killed renamable $sgpr6
  ; GFX10-NEXT:   S_BRANCH %bb.3
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.3:
  ; GFX10-NEXT:   S_ENDPGM 0
  bb.0:
    successors: %bb.1(0x80000000)
    liveins: $sgpr4

    renamable $sgpr9 = COPY $sgpr4
    renamable $vgpr5 = IMPLICIT_DEF
    renamable $sgpr0_sgpr1 = nofpexcept V_CMP_NGT_F32_e64 0, 0, 0, $vgpr5, 0, implicit $mode, implicit $exec
    S_BRANCH %bb.1

  bb.1:
    successors: %bb.2(0x40000000), %bb.8(0x40000000)
    liveins: $sgpr6, $sgpr9, $sgpr0_sgpr1

    $sgpr4_sgpr5 = S_AND_SAVEEXEC_B64 $sgpr0_sgpr1, implicit-def $exec, implicit-def $scc, implicit $exec
    renamable $sgpr14_sgpr15 = S_XOR_B64 $exec, killed renamable $sgpr4_sgpr5, implicit-def dead $scc
    S_CBRANCH_EXECZ %bb.8, implicit $exec
    S_BRANCH %bb.2

  bb.2:
    successors: %bb.8(0x40000000)
    liveins: $sgpr6

    $m0 = COPY killed renamable $sgpr6
    S_BRANCH %bb.8

  bb.8:

    S_ENDPGM 0

...
---
# Make sure COPY to $sgpr0_sgpr1 is not sunk after S_AND_SAVEEXEC_B64.
name:            _amdgpu_ps_main2
alignment:       1
tracksRegLiveness: true
registers:       []
liveins:
  - { reg: '$sgpr4', virtual-reg: '' }
  - { reg: '$sgpr6_sgpr7', virtual-reg: '' }
body:             |
  ; GFX10-LABEL: name: _amdgpu_ps_main2
  ; GFX10: bb.0:
  ; GFX10-NEXT:   successors: %bb.1(0x80000000)
  ; GFX10-NEXT:   liveins: $sgpr4, $sgpr6_sgpr7
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   renamable $sgpr9 = COPY $sgpr4
  ; GFX10-NEXT:   renamable $vgpr5 = IMPLICIT_DEF
  ; GFX10-NEXT:   renamable $sgpr0_sgpr1 = COPY $sgpr6_sgpr7
  ; GFX10-NEXT:   S_BRANCH %bb.1
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.1:
  ; GFX10-NEXT:   successors: %bb.2(0x40000000), %bb.3(0x40000000)
  ; GFX10-NEXT:   liveins: $sgpr6, $sgpr9, $sgpr0_sgpr1
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   $sgpr4_sgpr5 = S_AND_SAVEEXEC_B64 $sgpr0_sgpr1, implicit-def $exec, implicit-def $scc, implicit $exec
  ; GFX10-NEXT:   renamable $sgpr14_sgpr15 = S_XOR_B64 $exec, killed renamable $sgpr4_sgpr5, implicit-def dead $scc
  ; GFX10-NEXT:   S_CBRANCH_EXECZ %bb.3, implicit $exec
  ; GFX10-NEXT:   S_BRANCH %bb.2
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.2:
  ; GFX10-NEXT:   successors: %bb.3(0x80000000)
  ; GFX10-NEXT:   liveins: $sgpr6
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   $m0 = COPY killed renamable $sgpr6
  ; GFX10-NEXT:   S_BRANCH %bb.3
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.3:
  ; GFX10-NEXT:   S_ENDPGM 0
  bb.0:
    successors: %bb.1(0x80000000)
    liveins: $sgpr4, $sgpr6_sgpr7

    renamable $sgpr9 = COPY $sgpr4
    renamable $vgpr5 = IMPLICIT_DEF
    renamable $sgpr0_sgpr1 = COPY $sgpr6_sgpr7
    S_BRANCH %bb.1

  bb.1:
    successors: %bb.2(0x40000000), %bb.8(0x40000000)
    liveins: $sgpr6, $sgpr9, $sgpr0_sgpr1

    $sgpr4_sgpr5 = S_AND_SAVEEXEC_B64 $sgpr0_sgpr1, implicit-def $exec, implicit-def $scc, implicit $exec
    renamable $sgpr14_sgpr15 = S_XOR_B64 $exec, killed renamable $sgpr4_sgpr5, implicit-def dead $scc
    S_CBRANCH_EXECZ %bb.8, implicit $exec
    S_BRANCH %bb.2

  bb.2:
    successors: %bb.8(0x40000000)
    liveins: $sgpr6

    $m0 = COPY killed renamable $sgpr6
    S_BRANCH %bb.8

  bb.8:

    S_ENDPGM 0

...
---
# Make sure COPY to $sgpr2_sgpr3 is not sunk after S_AND_SAVEEXEC_B32.
name:            _amdgpu_ps_main3
alignment:       1
tracksRegLiveness: true
registers:       []
liveins:
  - { reg: '$sgpr6_sgpr7', virtual-reg: '' }
  - { reg: '$sgpr8', virtual-reg: '' }
body:             |
  ; GFX10-LABEL: name: _amdgpu_ps_main3
  ; GFX10: bb.0:
  ; GFX10-NEXT:   successors: %bb.1(0x80000000)
  ; GFX10-NEXT:   liveins: $sgpr6_sgpr7, $sgpr8
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   renamable $vgpr5 = IMPLICIT_DEF
  ; GFX10-NEXT:   renamable $sgpr0_sgpr1 = IMPLICIT_DEF
  ; GFX10-NEXT:   renamable $sgpr2_sgpr3 = COPY $sgpr6_sgpr7
  ; GFX10-NEXT:   S_BRANCH %bb.1
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.1:
  ; GFX10-NEXT:   successors: %bb.2(0x40000000), %bb.3(0x40000000)
  ; GFX10-NEXT:   liveins: $sgpr6, $sgpr8, $sgpr0_sgpr1, $sgpr2_sgpr3
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   $sgpr2 = S_AND_SAVEEXEC_B32 $sgpr8, implicit-def $exec, implicit-def $scc, implicit $exec
  ; GFX10-NEXT:   $sgpr4_sgpr5 = S_AND_SAVEEXEC_B64 $sgpr0_sgpr1, implicit-def $exec, implicit-def $scc, implicit $exec
  ; GFX10-NEXT:   renamable $sgpr14_sgpr15 = S_XOR_B64 $exec, killed renamable $sgpr4_sgpr5, implicit-def dead $scc
  ; GFX10-NEXT:   S_NOP 0, implicit $sgpr2_sgpr3
  ; GFX10-NEXT:   S_CBRANCH_EXECZ %bb.3, implicit $exec
  ; GFX10-NEXT:   S_BRANCH %bb.2
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.2:
  ; GFX10-NEXT:   successors: %bb.3(0x80000000)
  ; GFX10-NEXT:   liveins: $sgpr6
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   $m0 = COPY killed renamable $sgpr6
  ; GFX10-NEXT:   S_BRANCH %bb.3
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.3:
  ; GFX10-NEXT:   S_ENDPGM 0
  bb.0:
    successors: %bb.1(0x80000000)
    liveins: $sgpr6_sgpr7, $sgpr8

    renamable $vgpr5 = IMPLICIT_DEF
    renamable $sgpr0_sgpr1 = IMPLICIT_DEF
    renamable $sgpr2_sgpr3 = COPY $sgpr6_sgpr7
    S_BRANCH %bb.1

  bb.1:
    successors: %bb.2(0x40000000), %bb.8(0x40000000)
    liveins: $sgpr6, $sgpr8, $sgpr0_sgpr1, $sgpr2_sgpr3

    $sgpr2 = S_AND_SAVEEXEC_B32 $sgpr8, implicit-def $exec, implicit-def $scc, implicit $exec
    $sgpr4_sgpr5 = S_AND_SAVEEXEC_B64 $sgpr0_sgpr1, implicit-def $exec, implicit-def $scc, implicit $exec
    renamable $sgpr14_sgpr15 = S_XOR_B64 $exec, killed renamable $sgpr4_sgpr5, implicit-def dead $scc
    S_NOP 0, implicit $sgpr2_sgpr3
    S_CBRANCH_EXECZ %bb.8, implicit $exec
    S_BRANCH %bb.2

  bb.2:
    successors: %bb.8(0x40000000)
    liveins: $sgpr6

    $m0 = COPY killed renamable $sgpr6
    S_BRANCH %bb.8

  bb.8:

    S_ENDPGM 0

...

---
name:            machinesink_loop_vgpr_out_of_divergent_loop_postra
tracksRegLiveness: true
body:             |
  ; GFX10-LABEL: name: machinesink_loop_vgpr_out_of_divergent_loop_postra
  ; GFX10: bb.0:
  ; GFX10-NEXT:   successors: %bb.1(0x80000000)
  ; GFX10-NEXT:   liveins: $sgpr8, $vgpr0, $vgpr1
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.1:
  ; GFX10-NEXT:   successors: %bb.7(0x40000000), %bb.2(0x40000000)
  ; GFX10-NEXT:   liveins: $sgpr8, $vgpr0
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   $sgpr4 = S_AND_SAVEEXEC_B32 $sgpr8, implicit-def $exec, implicit-def $scc, implicit $exec
  ; GFX10-NEXT:   renamable $sgpr4 = S_XOR_B32 $exec_lo, killed renamable $sgpr4, implicit-def dead $scc
  ; GFX10-NEXT:   S_CBRANCH_EXECZ %bb.7, implicit $exec
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.2:
  ; GFX10-NEXT:   successors: %bb.3(0x80000000)
  ; GFX10-NEXT:   liveins: $sgpr4, $sgpr8, $vgpr0
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.3:
  ; GFX10-NEXT:   successors: %bb.5(0x40000000), %bb.4(0x40000000)
  ; GFX10-NEXT:   liveins: $sgpr4, $sgpr8, $vgpr0
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   $sgpr5 = S_AND_SAVEEXEC_B32 $sgpr8, implicit-def $exec, implicit-def $scc, implicit $exec
  ; GFX10-NEXT:   renamable $sgpr5 = S_XOR_B32 $exec_lo, killed renamable $sgpr5, implicit-def dead $scc
  ; GFX10-NEXT:   S_CBRANCH_EXECZ %bb.5, implicit $exec
  ; GFX10-NEXT:   S_BRANCH %bb.4
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.4:
  ; GFX10-NEXT:   successors: %bb.5(0x80000000)
  ; GFX10-NEXT:   liveins: $sgpr4, $sgpr5, $sgpr8, $vgpr0
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.5:
  ; GFX10-NEXT:   successors: %bb.3(0x40000000), %bb.6(0x40000000)
  ; GFX10-NEXT:   liveins: $sgpr4, $sgpr5, $sgpr8, $vgpr0
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   renamable $vgpr1 = V_ADD_U32_e64 $sgpr8, $vgpr0, 0, implicit $exec
  ; GFX10-NEXT:   renamable $sgpr5 = S_AND_B32 $exec_lo, killed renamable $sgpr5, implicit-def $scc
  ; GFX10-NEXT:   renamable $sgpr5 = S_OR_B32 killed renamable $sgpr5, renamable $sgpr4, implicit-def $scc
  ; GFX10-NEXT:   $exec_lo = S_ANDN2_B32 $exec_lo, renamable $sgpr5, implicit-def $scc
  ; GFX10-NEXT:   S_CBRANCH_EXECNZ %bb.3, implicit $exec
  ; GFX10-NEXT:   S_BRANCH %bb.6
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.6:
  ; GFX10-NEXT:   successors: %bb.3(0x80000000)
  ; GFX10-NEXT:   liveins: $sgpr4, $sgpr5, $sgpr8, $vgpr0, $vgpr1
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   $exec_lo = S_OR_B32 $exec_lo, killed renamable $sgpr5, implicit-def $scc
  ; GFX10-NEXT:   INLINEASM &"", 1 /* sideeffect attdialect */, implicit killed renamable $vgpr1
  ; GFX10-NEXT:   S_BRANCH %bb.3
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.7:
  ; GFX10-NEXT:   successors: %bb.1(0x40000000), %bb.8(0x40000000)
  ; GFX10-NEXT:   liveins: $sgpr4, $sgpr8, $vgpr0
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   $exec_lo = S_ANDN2_B32 $exec_lo, killed renamable $sgpr4, implicit-def $scc
  ; GFX10-NEXT:   S_CBRANCH_EXECNZ %bb.1, implicit $exec
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.8:
  ; GFX10-NEXT:   successors: %bb.9(0x80000000)
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.9:
  ; GFX10-NEXT:   successors: %bb.9(0x40000000), %bb.10(0x40000000)
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   S_CBRANCH_VCCNZ %bb.9, implicit undef $vcc
  ; GFX10-NEXT:   S_BRANCH %bb.10
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.10:
  ; GFX10-NEXT:   SI_RETURN
  bb.0:
    liveins: $sgpr8, $vgpr0, $vgpr1

  bb.1:
    liveins: $sgpr8, $vgpr0

    $sgpr4 = S_AND_SAVEEXEC_B32 $sgpr8, implicit-def $exec, implicit-def $scc, implicit $exec
    renamable $sgpr4 = S_XOR_B32 $exec_lo, killed renamable $sgpr4, implicit-def dead $scc
    S_CBRANCH_EXECZ %bb.6, implicit $exec

  bb.9:
    liveins: $sgpr4, $sgpr8, $vgpr0


  bb.2:
    liveins: $sgpr4, $sgpr8, $vgpr0

    $sgpr5 = S_AND_SAVEEXEC_B32 $sgpr8, implicit-def $exec, implicit-def $scc, implicit $exec
    renamable $sgpr5 = S_XOR_B32 $exec_lo, killed renamable $sgpr5, implicit-def dead $scc
    S_CBRANCH_EXECZ %bb.4, implicit $exec
    S_BRANCH %bb.3

  bb.3:
    liveins: $sgpr4, $sgpr5, $sgpr8, $vgpr0


  bb.4:
    liveins: $sgpr4, $sgpr5, $sgpr8, $vgpr0

    renamable $vgpr1 = V_ADD_U32_e64 $sgpr8, $vgpr0, 0, implicit $exec
    renamable $sgpr5 = S_AND_B32 $exec_lo, killed renamable $sgpr5, implicit-def $scc
    renamable $sgpr5 = S_OR_B32 killed renamable $sgpr5, renamable $sgpr4, implicit-def $scc

    $exec_lo = S_ANDN2_B32 $exec_lo, renamable $sgpr5, implicit-def $scc
    S_CBRANCH_EXECNZ %bb.2, implicit $exec
    S_BRANCH %bb.5

  bb.5:
    liveins: $sgpr4, $sgpr5, $sgpr8, $vgpr0, $vgpr1

    $exec_lo = S_OR_B32 $exec_lo, killed renamable $sgpr5, implicit-def $scc
    INLINEASM &"", 1 /* sideeffect attdialect */, implicit killed renamable $vgpr1
    S_BRANCH %bb.2

  bb.6:
    liveins: $sgpr4, $sgpr8, $vgpr0

    $exec_lo = S_ANDN2_B32 $exec_lo, killed renamable $sgpr4, implicit-def $scc
    S_CBRANCH_EXECNZ %bb.1, implicit $exec

  bb.10:

  bb.7:
    S_CBRANCH_VCCNZ %bb.7, implicit undef $vcc
    S_BRANCH %bb.8

  bb.8:
    SI_RETURN

...

---
name:            machinesink_loop_sgpr_out_of_divergent_loop_postra
tracksRegLiveness: true
body:             |
  ; GFX10-LABEL: name: machinesink_loop_sgpr_out_of_divergent_loop_postra
  ; GFX10: bb.0:
  ; GFX10-NEXT:   successors: %bb.1(0x80000000)
  ; GFX10-NEXT:   liveins: $sgpr8, $sgpr9, $sgpr10
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.1:
  ; GFX10-NEXT:   successors: %bb.7(0x40000000), %bb.2(0x40000000)
  ; GFX10-NEXT:   liveins: $sgpr8, $sgpr9
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   $sgpr4 = S_AND_SAVEEXEC_B32 $sgpr9, implicit-def $exec, implicit-def $scc, implicit $exec
  ; GFX10-NEXT:   renamable $sgpr4 = S_XOR_B32 $exec_lo, killed renamable $sgpr4, implicit-def dead $scc
  ; GFX10-NEXT:   S_CBRANCH_EXECZ %bb.7, implicit $exec
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.2:
  ; GFX10-NEXT:   successors: %bb.3(0x80000000)
  ; GFX10-NEXT:   liveins: $sgpr4, $sgpr8, $sgpr9
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.3:
  ; GFX10-NEXT:   successors: %bb.5(0x40000000), %bb.4(0x40000000)
  ; GFX10-NEXT:   liveins: $sgpr4, $sgpr8, $sgpr9
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   $sgpr5 = S_AND_SAVEEXEC_B32 $sgpr9, implicit-def $exec, implicit-def $scc, implicit $exec
  ; GFX10-NEXT:   renamable $sgpr5 = S_XOR_B32 $exec_lo, killed renamable $sgpr5, implicit-def dead $scc
  ; GFX10-NEXT:   S_CBRANCH_EXECZ %bb.5, implicit $exec
  ; GFX10-NEXT:   S_BRANCH %bb.4
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.4:
  ; GFX10-NEXT:   successors: %bb.5(0x80000000)
  ; GFX10-NEXT:   liveins: $sgpr4, $sgpr5, $sgpr8, $sgpr9
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.5:
  ; GFX10-NEXT:   successors: %bb.3(0x40000000), %bb.6(0x40000000)
  ; GFX10-NEXT:   liveins: $sgpr4, $sgpr5, $sgpr8, $sgpr9
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   renamable $sgpr6 = S_ADD_I32 renamable $sgpr8, renamable $sgpr9, implicit-def dead $scc
  ; GFX10-NEXT:   renamable $sgpr5 = S_AND_B32 $exec_lo, killed renamable $sgpr5, implicit-def $scc
  ; GFX10-NEXT:   renamable $sgpr5 = S_OR_B32 killed renamable $sgpr5, renamable $sgpr4, implicit-def $scc
  ; GFX10-NEXT:   INLINEASM &"", 1 /* sideeffect attdialect */
  ; GFX10-NEXT:   $exec_lo = S_ANDN2_B32 $exec_lo, renamable $sgpr5, implicit-def $scc
  ; GFX10-NEXT:   S_CBRANCH_EXECNZ %bb.3, implicit $exec
  ; GFX10-NEXT:   S_BRANCH %bb.6
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.6:
  ; GFX10-NEXT:   successors: %bb.3(0x80000000)
  ; GFX10-NEXT:   liveins: $sgpr4, $sgpr5, $sgpr6, $sgpr8, $sgpr9
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   $exec_lo = S_OR_B32 $exec_lo, killed renamable $sgpr5, implicit-def $scc
  ; GFX10-NEXT:   INLINEASM &"", 1 /* sideeffect attdialect */, implicit killed renamable $sgpr6
  ; GFX10-NEXT:   S_BRANCH %bb.3
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.7:
  ; GFX10-NEXT:   successors: %bb.1(0x40000000), %bb.8(0x40000000)
  ; GFX10-NEXT:   liveins: $sgpr4, $sgpr8, $sgpr9
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   $exec_lo = S_ANDN2_B32 $exec_lo, killed renamable $sgpr4, implicit-def $scc
  ; GFX10-NEXT:   S_CBRANCH_EXECNZ %bb.1, implicit $exec
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.8:
  ; GFX10-NEXT:   successors: %bb.9(0x80000000)
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.9:
  ; GFX10-NEXT:   successors: %bb.9(0x40000000), %bb.10(0x40000000)
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT:   S_CBRANCH_VCCNZ %bb.9, implicit undef $vcc
  ; GFX10-NEXT:   S_BRANCH %bb.10
  ; GFX10-NEXT: {{  $}}
  ; GFX10-NEXT: bb.10:
  ; GFX10-NEXT:   SI_RETURN
  bb.0:
    liveins: $sgpr8, $sgpr9, $sgpr10


  bb.1:
    liveins: $sgpr8, $sgpr9

    $sgpr4 = S_AND_SAVEEXEC_B32 $sgpr9, implicit-def $exec, implicit-def $scc, implicit $exec
    renamable $sgpr4 = S_XOR_B32 $exec_lo, killed renamable $sgpr4, implicit-def dead $scc
    S_CBRANCH_EXECZ %bb.6, implicit $exec

  bb.9:
    liveins: $sgpr4, $sgpr8, $sgpr9


  bb.2:
    liveins: $sgpr4, $sgpr8, $sgpr9

    $sgpr5 = S_AND_SAVEEXEC_B32 $sgpr9, implicit-def $exec, implicit-def $scc, implicit $exec
    renamable $sgpr5 = S_XOR_B32 $exec_lo, killed renamable $sgpr5, implicit-def dead $scc
    S_CBRANCH_EXECZ %bb.4, implicit $exec
    S_BRANCH %bb.3

  bb.3:
    liveins: $sgpr4, $sgpr5, $sgpr8, $sgpr9


  bb.4:
    liveins: $sgpr4, $sgpr5, $sgpr8, $sgpr9

    renamable $sgpr6 = S_ADD_I32 renamable $sgpr8, renamable $sgpr9, implicit-def dead $scc
    renamable $sgpr5 = S_AND_B32 $exec_lo, killed renamable $sgpr5, implicit-def $scc
    renamable $sgpr5 = S_OR_B32 killed renamable $sgpr5, renamable $sgpr4, implicit-def $scc
    INLINEASM &"", 1 /* sideeffect attdialect */
    $exec_lo = S_ANDN2_B32 $exec_lo, renamable $sgpr5, implicit-def $scc
    S_CBRANCH_EXECNZ %bb.2, implicit $exec
    S_BRANCH %bb.5

  bb.5:
    liveins: $sgpr4, $sgpr5, $sgpr6, $sgpr8, $sgpr9

    $exec_lo = S_OR_B32 $exec_lo, killed renamable $sgpr5, implicit-def $scc
    INLINEASM &"", 1 /* sideeffect attdialect */, implicit killed renamable $sgpr6
    S_BRANCH %bb.2

  bb.6:
    liveins: $sgpr4, $sgpr8, $sgpr9

    $exec_lo = S_ANDN2_B32 $exec_lo, killed renamable $sgpr4, implicit-def $scc
    S_CBRANCH_EXECNZ %bb.1, implicit $exec

  bb.10:

  bb.7:
    S_CBRANCH_VCCNZ %bb.7, implicit undef $vcc
    S_BRANCH %bb.8

  bb.8:
    SI_RETURN

...