llvm/llvm/test/CodeGen/AMDGPU/insert-singleuse-vdst.mir

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
# RUN: llc -mtriple=amdgcn -mcpu=gfx1150 -verify-machineinstrs -run-pass=amdgpu-insert-single-use-vdst %s -o - | FileCheck %s

# One single-use producer.
---
name: one_producer
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: one_producer
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_ADD_U32_e32 $vgpr0, $vgpr1, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr0, $vgpr2
  bb.0:
    liveins: $vgpr0
    $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr2 = V_ADD_U32_e32 $vgpr0, $vgpr1, implicit $exec
  bb.1:
    liveins: $vgpr0, $vgpr2
...

# One single-use producer of a 64-bit value.
---
name: one_producer_64bit
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: one_producer_64bit
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0_vgpr1
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr2_vgpr3 = V_LSHLREV_B64_e64 0, $vgpr0_vgpr1, implicit $exec
  ; CHECK-NEXT:   $vgpr4_vgpr5 = V_MOV_B64_e64 $vgpr2_vgpr3, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr4_vgpr5
  bb.0:
    liveins: $vgpr0_vgpr1
    $vgpr2_vgpr3 = V_LSHLREV_B64_e64 0, $vgpr0_vgpr1, implicit $exec
    $vgpr4_vgpr5 = V_MOV_B64_e64 $vgpr2_vgpr3, implicit $exec
  bb.1:
    liveins: $vgpr4_vgpr5
...

# Two consecutive single-use producers.
---
name: two_producers
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: two_producers
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 2
  ; CHECK-NEXT:   $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_ADD_U32_e32 $vgpr0, $vgpr1, implicit $exec
  ; CHECK-NEXT:   $vgpr3 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr0, $vgpr3
  bb.0:
    liveins: $vgpr0
    $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr2 = V_ADD_U32_e32 $vgpr0, $vgpr1, implicit $exec
    $vgpr3 = V_ADD_U32_e32 $vgpr0, $vgpr2, implicit $exec
  bb.1:
    liveins: $vgpr0, $vgpr3
...

# Redefinitions of v0.
---
name: redefinitions
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: redefinitions
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 4
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  bb.0:
    liveins: $vgpr0
    $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
...

# One producer with no consumers.
---
name: no_consumer
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: no_consumer
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  bb.0:
    liveins: $vgpr0
    $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
  bb.1:
...

# One consumer with two uses of the same value.
---
name: one_consumer_two_uses
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: one_consumer_two_uses
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_ADD_U32_e32 $vgpr1, $vgpr1, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr0, $vgpr2
  bb.0:
    liveins: $vgpr0
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr2 = V_ADD_U32_e32 $vgpr1, $vgpr1, implicit $exec
  bb.1:
    liveins: $vgpr0, $vgpr2
...

# A longer example.
---
name: longer_example
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: longer_example
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr3, $vgpr5, $sgpr0, $sgpr2, $sgpr4, $sgpr5, $sgpr16, $sgpr17, $sgpr18, $sgpr19
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 274
  ; CHECK-NEXT:   $vgpr14 = V_MUL_F32_e32 $sgpr4, $vgpr3, implicit $exec, implicit $mode
  ; CHECK-NEXT:   $sgpr3 = S_MUL_F16 $sgpr0, $sgpr2, implicit $mode
  ; CHECK-NEXT:   $vgpr15 = V_MUL_F32_e32 $sgpr5, $vgpr3, implicit $exec, implicit $mode
  ; CHECK-NEXT:   $vgpr17 = V_FMA_F32_e64 0, $sgpr16, 0, $vgpr5, 0, $vgpr14, 0, 0, implicit $exec, implicit $mode
  ; CHECK-NEXT:   $sgpr1 = S_ADD_F16 $sgpr0, 15360, implicit $mode
  ; CHECK-NEXT:   $vgpr15 = V_FMA_F32_e64 0, $sgpr17, 0, $vgpr5, 0, $vgpr15, 0, 0, implicit $exec, implicit $mode
  ; CHECK-NEXT:   $vgpr14 = V_FMA_F32_e64 0, $sgpr18, 0, $vgpr15, 0, $vgpr17, 0, 0, implicit $exec, implicit $mode
  ; CHECK-NEXT:   $vgpr15 = V_FMA_F32_e64 0, $sgpr19, 0, $vgpr14, 0, $vgpr17, 0, 0, implicit $exec, implicit $mode
  ; CHECK-NEXT:   $vgpr16 = V_LOG_F32_e32 $vgpr15, implicit $exec, implicit $mode
  ; CHECK-NEXT:   $vgpr18 = V_EXP_F32_e32 $vgpr15, implicit $exec, implicit $mode
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr16, $vgpr18
  bb.0:
    liveins: $vgpr3, $vgpr5, $sgpr0, $sgpr2, $sgpr4, $sgpr5, $sgpr16, $sgpr17, $sgpr18, $sgpr19
    $vgpr14 = V_MUL_F32_e32 $sgpr4, $vgpr3, implicit $exec, implicit $mode
    $sgpr3 = S_MUL_F16 $sgpr0, $sgpr2, implicit $mode
    $vgpr15 = V_MUL_F32_e32 $sgpr5, $vgpr3, implicit $exec, implicit $mode
    $vgpr17 = V_FMA_F32_e64 0, $sgpr16, 0, $vgpr5, 0, $vgpr14, 0, 0, implicit $exec, implicit $mode
    $sgpr1 = S_ADD_F16 $sgpr0, 15360, implicit $mode
    $vgpr15 = V_FMA_F32_e64 0, $sgpr17, 0, $vgpr5, 0, $vgpr15, 0, 0, implicit $exec, implicit $mode
    $vgpr14 = V_FMA_F32_e64 0, $sgpr18, 0, $vgpr15, 0, $vgpr17, 0, 0, implicit $exec, implicit $mode
    $vgpr15 = V_FMA_F32_e64 0, $sgpr19, 0, $vgpr14, 0, $vgpr17, 0, 0, implicit $exec, implicit $mode
    $vgpr16 = V_LOG_F32_e32 $vgpr15, implicit $exec, implicit $mode
    $vgpr18 = V_EXP_F32_e32 $vgpr15, implicit $exec, implicit $mode
  bb.1:
    liveins: $vgpr16, $vgpr18
...

# Multiple uses of v0.
---
name: multiple_uses_1
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: multiple_uses_1
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr1, $vgpr2
  bb.0:
    liveins: $vgpr0
    $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr1, $vgpr2
...

# Multiple uses of v0 and redefinitions of v1 and v2.
---
name: multiple_uses_2
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: multiple_uses_2
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 2
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr1, $vgpr2
  bb.0:
    liveins: $vgpr0
    $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr1, $vgpr2
...

# Multiple uses of all but v1.
---
name: multiple_uses_3
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: multiple_uses_3
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr3 = V_MOV_B32_e32 $vgpr1, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr2, $vgpr3
  bb.0:
    liveins: $vgpr0
    $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr3 = V_MOV_B32_e32 $vgpr1, implicit $exec
  bb.1:
    liveins: $vgpr2, $vgpr3
...

# Second use is an instruction that reads and writes v1.
---
name: multiple_uses_4
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: multiple_uses_4
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_ADD_U32_e32 $vgpr0, $vgpr1, implicit $exec
  ; CHECK-NEXT:   $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr1, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr0, $vgpr1, $vgpr2
  bb.0:
    liveins: $vgpr0
    $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr2 = V_ADD_U32_e32 $vgpr0, $vgpr1, implicit $exec
    $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr1, implicit $exec
  bb.1:
    liveins: $vgpr0, $vgpr1, $vgpr2
...

# Results are live-in to another basic block.
---
name: basic_block_1
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: basic_block_1
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   successors: %bb.2(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0, $vgpr1, $vgpr2
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.2:
  ; CHECK-NEXT:   liveins: $vgpr1, $vgpr2
  bb.0:
    liveins: $vgpr0
    $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr0, $vgpr1, $vgpr2
    $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.2:
    liveins: $vgpr1, $vgpr2
...

# Result v2 has multiple uses in another basic block.
---
name: basic_block_2
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: basic_block_2
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0, $vgpr1
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr1, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   successors: %bb.2(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr2
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr3 = V_MOV_B32_e32 $vgpr2, implicit $exec
  ; CHECK-NEXT:   $vgpr3 = V_MOV_B32_e32 $vgpr2, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.2:
  ; CHECK-NEXT:   liveins: $vgpr3
  bb.0:
    liveins: $vgpr0, $vgpr1
    $vgpr2 = V_MOV_B32_e32 $vgpr1, implicit $exec
  bb.1:
    liveins: $vgpr2
    $vgpr3 = V_MOV_B32_e32 $vgpr2, implicit $exec
    $vgpr3 = V_MOV_B32_e32 $vgpr2, implicit $exec
  bb.2:
    liveins: $vgpr3
...

# Results are redefined in another basic block.
---
name: basic_block_3
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: basic_block_3
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   successors: %bb.2(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0, $vgpr1
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr1, implicit $exec
  ; CHECK-NEXT:   $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr1, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_ADD_U32_e32 $vgpr0, $vgpr1, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.2:
  ; CHECK-NEXT:   liveins: $vgpr0, $vgpr1, $vgpr2
  bb.0:
    liveins: $vgpr0
    $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr0, $vgpr1
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr1, implicit $exec
    $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr1, implicit $exec
    $vgpr2 = V_ADD_U32_e32 $vgpr0, $vgpr1, implicit $exec
  bb.2:
    liveins: $vgpr0, $vgpr1, $vgpr2
...

# Exec modified between producer and consumer.
---
name: exec_mask
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: exec_mask
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $sgpr0_sgpr1
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 0, implicit $exec
  ; CHECK-NEXT:   $exec = COPY $sgpr0_sgpr1
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr0
  bb.0:
    liveins: $sgpr0_sgpr1
    $vgpr0 = V_MOV_B32_e32 0, implicit $exec
    $exec = COPY $sgpr0_sgpr1
    $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr0
...

# Exec_lo modified between producer and consumer.
---
name: exec_mask_lo
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: exec_mask_lo
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $sgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 0, implicit $exec
  ; CHECK-NEXT:   $exec_lo = COPY $sgpr0
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr0
  bb.0:
    liveins: $sgpr0
    $vgpr0 = V_MOV_B32_e32 0, implicit $exec
    $exec_lo = COPY $sgpr0
    $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr0
...

# Exec_hi modified between producer and consumer.
---
name: exec_mask_hi
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: exec_mask_hi
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $sgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 0, implicit $exec
  ; CHECK-NEXT:   $exec_hi = COPY $sgpr0
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr0
  bb.0:
    liveins: $sgpr0
    $vgpr0 = V_MOV_B32_e32 0, implicit $exec
    $exec_hi = COPY $sgpr0
    $vgpr0 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr0
...

# Write 32-bit vgpr and then read from low 16 bits.
---
name: write_full_read_lo
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: write_full_read_lo
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 0, implicit $exec
  ; CHECK-NEXT:   $vgpr1_lo16 = V_MOV_B16_t16_e32 $vgpr0_lo16, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr1_lo16
  bb.0:
    $vgpr0 = V_MOV_B32_e32 0, implicit $exec
    $vgpr1_lo16 = V_MOV_B16_t16_e32 $vgpr0_lo16, implicit $exec
  bb.1:
    liveins: $vgpr1_lo16
...

# Write 32-bit vgpr and then read from high 16 bits.
---
name: write_full_read_hi
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: write_full_read_hi
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 0, implicit $exec
  ; CHECK-NEXT:   $vgpr1_hi16 = V_MOV_B16_t16_e32 $vgpr0_hi16, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr1_hi16
  bb.0:
    $vgpr0 = V_MOV_B32_e32 0, implicit $exec
    $vgpr1_hi16 = V_MOV_B16_t16_e32 $vgpr0_hi16, implicit $exec
  bb.1:
    liveins: $vgpr1_hi16
...

# Write 32-bit vgpr and then read from both halves.
---
name: write_full_read_both
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: write_full_read_both
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 0, implicit $exec
  ; CHECK-NEXT:   $vgpr1_lo16 = V_MOV_B16_t16_e32 $vgpr0_lo16, implicit $exec
  ; CHECK-NEXT:   $vgpr1_hi16 = V_MOV_B16_t16_e32 $vgpr0_hi16, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr1
  bb.0:
    $vgpr0 = V_MOV_B32_e32 0, implicit $exec
    $vgpr1_lo16 = V_MOV_B16_t16_e32 $vgpr0_lo16, implicit $exec
    $vgpr1_hi16 = V_MOV_B16_t16_e32 $vgpr0_hi16, implicit $exec
  bb.1:
    liveins: $vgpr1
...

# Write 32-bit vgpr and then read from both halves in the same instruction.
---
name: write_full_read_both_same_instruction
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: write_full_read_both_same_instruction
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr0 = V_MOV_B32_e32 0, implicit $exec
  ; CHECK-NEXT:   $vgpr1_lo16 = V_ADD_F16_t16_e32 $vgpr0_lo16, $vgpr0_hi16, implicit $mode, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr1_lo16
  bb.0:
    $vgpr0 = V_MOV_B32_e32 0, implicit $exec
    $vgpr1_lo16 = V_ADD_F16_t16_e32 $vgpr0_lo16, $vgpr0_hi16, implicit $mode, implicit $exec
  bb.1:
    liveins: $vgpr1_lo16
...

# Write low 16-bits and then read 32-bit vgpr.
---
name: write_lo_read_full
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: write_lo_read_full
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr0_lo16 = V_MOV_B16_t16_e32 0, implicit $exec
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr1
  bb.0:
    liveins: $vgpr0
    $vgpr0_lo16 = V_MOV_B16_t16_e32 0, implicit $exec
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr1
...

# Write low 16-bits and then read 32-bit vgpr twice.
---
name: write_lo_read_full_twice
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: write_lo_read_full_twice
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr0_lo16 = V_MOV_B16_t16_e32 0, implicit $exec
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr1, $vgpr2
  bb.0:
    liveins: $vgpr0
    $vgpr0_lo16 = V_MOV_B16_t16_e32 0, implicit $exec
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr1, $vgpr2
...

# Write high 16-bits and then read 32-bit vgpr.
---
name: write_hi_read_full
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: write_hi_read_full
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr0_hi16 = V_MOV_B16_t16_e32 0, implicit $exec
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr1
  bb.0:
    liveins: $vgpr0
    $vgpr0_hi16 = V_MOV_B16_t16_e32 0, implicit $exec
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr1
...

# Write high 16-bits and then read 32-bit vgpr twice.
---
name: write_hi_read_full_twice
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: write_hi_read_full_twice
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr0_hi16 = V_MOV_B16_t16_e32 0, implicit $exec
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr1, $vgpr2
  bb.0:
    liveins: $vgpr0
    $vgpr0_hi16 = V_MOV_B16_t16_e32 0, implicit $exec
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr1, $vgpr2
...

# Write low 16-bits and then write high 16-bits and then read 32-bit vgpr.
---
name: write_both_read_full
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: write_both_read_full
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 2
  ; CHECK-NEXT:   $vgpr0_lo16 = V_MOV_B16_t16_e32 0, implicit $exec
  ; CHECK-NEXT:   $vgpr0_hi16 = V_MOV_B16_t16_e32 0, implicit $exec
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr1
  bb.0:
    $vgpr0_lo16 = V_MOV_B16_t16_e32 0, implicit $exec
    $vgpr0_hi16 = V_MOV_B16_t16_e32 0, implicit $exec
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr1
...

# Write low 16-bits and then write high 16-bits and then read 32-bit vgpr twice.
---
name: write_both_read_full_twice
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: write_both_read_full_twice
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr0_lo16 = V_MOV_B16_t16_e32 0, implicit $exec
  ; CHECK-NEXT:   $vgpr0_hi16 = V_MOV_B16_t16_e32 0, implicit $exec
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr1, $vgpr2
  bb.0:
    $vgpr0_lo16 = V_MOV_B16_t16_e32 0, implicit $exec
    $vgpr0_hi16 = V_MOV_B16_t16_e32 0, implicit $exec
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr1, $vgpr2
...

# Three single use producer instructions with non single use producer
# instructions in between.
---
name: three_producers_with_two_skips
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: three_producers_with_two_skips
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 9361
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr4 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr5 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr2, $vgpr4
  bb.0:
    liveins: $vgpr0
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr4 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr5 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr2, $vgpr4
...

# Six single use producer instructions with non single use producer
# instructions in between.
---
name: six_producers_with_four_skips
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: six_producers_with_four_skips
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 145
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr4 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 9362
  ; CHECK-NEXT:   $vgpr5 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr6 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr7 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr8 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr9 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr10 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr2, $vgpr4, $vgpr7, $vgpr9
  bb.0:
    liveins: $vgpr0
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr4 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr5 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr6 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr7 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr8 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr9 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr10 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr2, $vgpr4, $vgpr7, $vgpr9
...

# Five single use producer instructions, followed by
# four non single use producers, followed by
# three single use producer instructions, followed by
# two non single use producers, followed by
# one single use producer instructions.
---
name: immediate_order
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: immediate_order
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 10693
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr4 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr5 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr6 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr7 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr8 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr9 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr10 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr11 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr12 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr13 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr14 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr15 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr6, $vgpr7, $vgpr8, $vgpr9, $vgpr13, $vgpr14
  bb.0:
    liveins: $vgpr0
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr4 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr5 = V_MOV_B32_e32 $vgpr0, implicit $exec

    $vgpr6 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr7 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr8 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr9 = V_MOV_B32_e32 $vgpr0, implicit $exec

    $vgpr10 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr11 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr12 = V_MOV_B32_e32 $vgpr0, implicit $exec

    $vgpr13 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr14 = V_MOV_B32_e32 $vgpr0, implicit $exec

    $vgpr15 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr6, $vgpr7, $vgpr8, $vgpr9, $vgpr13, $vgpr14
...

# Maximum number of single use producers that can be encoded in a single
# instruction.
---
name: maximum_producers_single_instruction
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: maximum_producers_single_instruction
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 58255
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr4 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr5 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr6 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr7 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr8 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr9 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr10 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr11 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr12 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr13 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr14 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr15 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr16 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr17 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr18 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr19 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr20 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr21 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr22 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr23 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr24 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr25 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr26 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr27 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr28 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr29 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  bb.0:
    liveins: $vgpr0
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr4 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr5 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr6 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr7 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr8 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr9 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr10 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr11 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr12 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr13 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr14 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr15 = V_MOV_B32_e32 $vgpr0, implicit $exec

    $vgpr16 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr17 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr18 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr19 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr20 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr21 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr22 = V_MOV_B32_e32 $vgpr0, implicit $exec

    $vgpr23 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr24 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr25 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr26 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr27 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr28 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr29 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
...

# One more than the maximum number of single use producers that can be encoded
# in a single instruction.
---
name: too_many_producers_single_instruction
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: too_many_producers_single_instruction
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 58255
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr4 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr5 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr6 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr7 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr8 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr9 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr10 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr11 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr12 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr13 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr14 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr15 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr16 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr17 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr18 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr19 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr20 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr21 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr22 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr23 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr24 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr25 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr26 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr27 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr28 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr29 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr30 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:



  bb.0:
    liveins: $vgpr0
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr4 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr5 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr6 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr7 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr8 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr9 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr10 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr11 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr12 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr13 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr14 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr15 = V_MOV_B32_e32 $vgpr0, implicit $exec

    $vgpr16 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr17 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr18 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr19 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr20 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr21 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr22 = V_MOV_B32_e32 $vgpr0, implicit $exec

    $vgpr23 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr24 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr25 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr26 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr27 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr28 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr29 = V_MOV_B32_e32 $vgpr0, implicit $exec

    $vgpr30 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
...

# Maximum distance between single use producers that can be encoded in a single
# instruction.
---
name: maximum_skips_single_instruction
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: maximum_skips_single_instruction
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 15473
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr4 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr5 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr6 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr7 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr8 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr9 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr10 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr11 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr12 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr13 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr14 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr15 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr16 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr2, $vgpr3, $vgpr4, $vgpr5, $vgpr6, $vgpr7, $vgpr8, $vgpr9, $vgpr10, $vgpr11, $vgpr12, $vgpr13, $vgpr14, $vgpr15
  bb.0:
    liveins: $vgpr0
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec

    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr4 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr5 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr6 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr7 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr8 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr9 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr10 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr11 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr12 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr13 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr14 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr15 = V_MOV_B32_e32 $vgpr0, implicit $exec

    $vgpr16 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr2, $vgpr3, $vgpr4, $vgpr5, $vgpr6, $vgpr7, $vgpr8, $vgpr9, $vgpr10, $vgpr11, $vgpr12, $vgpr13, $vgpr14, $vgpr15
...

# One more than the maximum distance between single use producers that can be
# encoded in a single instruction.
---
name: too_many_skips_single_instruction
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: too_many_skips_single_instruction
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr4 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr5 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr6 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr7 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr8 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr9 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr10 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr11 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr12 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr13 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr14 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr15 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr16 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr17 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr2, $vgpr3, $vgpr4, $vgpr5, $vgpr6, $vgpr7, $vgpr8, $vgpr9, $vgpr10, $vgpr11, $vgpr12, $vgpr13, $vgpr14, $vgpr15, $vgpr16
  bb.0:
    liveins: $vgpr0
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec

    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr4 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr5 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr6 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr7 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr8 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr9 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr10 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr11 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr12 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr13 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr14 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr15 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr16 = V_MOV_B32_e32 $vgpr0, implicit $exec

    $vgpr17 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr2, $vgpr3, $vgpr4, $vgpr5, $vgpr6, $vgpr7, $vgpr8, $vgpr9, $vgpr10, $vgpr11, $vgpr12, $vgpr13, $vgpr14, $vgpr15, $vgpr16
...


# Maximum possible encoding value with all bits of the immediate set
---
name: all_immediate_bits_set
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: all_immediate_bits_set
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 65535
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr4 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr5 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr6 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr7 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr8 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr9 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr10 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr11 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr12 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr13 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr14 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr15 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr16 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr17 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr18 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr19 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr20 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr21 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr22 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr23 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr24 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr25 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr26 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr27 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr28 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr29 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr30 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr31 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr32 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr33 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr34 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr35 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr36 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr37 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr38 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr39 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr40 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr41 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr42 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr43 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr16, $vgpr17, $vgpr18, $vgpr19, $vgpr20, $vgpr21, $vgpr22, $vgpr30, $vgpr31, $vgpr31, $vgpr32, $vgpr33, $vgpr34, $vgpr35, $vgpr36
  bb.0:
    liveins: $vgpr0
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr3 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr4 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr5 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr6 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr7 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr8 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr9 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr10 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr11 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr12 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr13 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr14 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr15 = V_MOV_B32_e32 $vgpr0, implicit $exec

    $vgpr16 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr17 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr18 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr19 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr20 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr21 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr22 = V_MOV_B32_e32 $vgpr0, implicit $exec

    $vgpr23 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr24 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr25 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr26 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr27 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr28 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr29 = V_MOV_B32_e32 $vgpr0, implicit $exec

    $vgpr30 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr31 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr32 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr33 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr34 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr35 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr36 = V_MOV_B32_e32 $vgpr0, implicit $exec

    $vgpr37 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr38 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr39 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr40 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr41 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr42 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr43 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr16, $vgpr17, $vgpr18, $vgpr19, $vgpr20, $vgpr21, $vgpr22, $vgpr30, $vgpr31, $vgpr31, $vgpr32, $vgpr33, $vgpr34, $vgpr35, $vgpr36

...

# Tests for multi-cycle instructions that are explicitly excluded.

# Valid producers but invalid consumer opcodes.
---
name: v_mul_hi_u32_e64
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: v_mul_hi_u32_e64
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr2 = V_MUL_HI_U32_e64 $vgpr0, $vgpr1, implicit $exec
  ; CHECK-NEXT:   $vgpr3 = V_MOV_B32_e32 $vgpr2, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr0, $vgpr3
  bb.0:
    liveins: $vgpr0
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr2 = V_MUL_HI_U32_e64 $vgpr0, $vgpr1, implicit $exec
    $vgpr3 = V_MOV_B32_e32 $vgpr2, implicit $exec
  bb.1:
    liveins: $vgpr0, $vgpr3
...

---
name: v_cmpx_t_u64_e64
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: v_cmpx_t_u64_e64
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $sgpr0 = V_CMPX_EQ_U64_e64 $vgpr0_vgpr1, $vgpr2_vgpr3, implicit-def $exec, implicit $exec
  ; CHECK-NEXT:   S_BRANCH %bb.1
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr0
  bb.0:
    liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $sgpr0 = V_CMPX_EQ_U64_e64 $vgpr0_vgpr1, $vgpr2_vgpr3, implicit-def $exec, implicit $exec
    S_BRANCH %bb.1
  bb.1:
    liveins: $vgpr0
...

---
name: v_lshlrev_b64_e64
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: v_lshlrev_b64_e64
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0_vgpr1
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr2_vgpr3 = V_MOV_B64_e64 $vgpr0_vgpr1, implicit $exec
  ; CHECK-NEXT:   $vgpr4_vgpr5 = V_LSHLREV_B64_e64 0, $vgpr2_vgpr3, implicit $exec
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr6_vgpr7 = V_LSHLREV_B64_e64 0, $vgpr4_vgpr5, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr4_vgpr5
  bb.0:
    liveins: $vgpr0_vgpr1
    $vgpr2_vgpr3 = V_MOV_B64_e64 $vgpr0_vgpr1, implicit $exec
    $vgpr4_vgpr5 = V_LSHLREV_B64_e64 0, $vgpr2_vgpr3, implicit $exec
    $vgpr6_vgpr7 = V_LSHLREV_B64_e64 0, $vgpr4_vgpr5, implicit $exec
  bb.1:
    liveins: $vgpr4_vgpr5
...

# Invalid producers but valid consumer opcodes.
---
name: v_movereld_b32_e32
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: v_movereld_b32_e32
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0, $vgpr2
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $m0 = S_MOV_B32 0
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   V_MOVRELD_B32_e32 $vgpr2, $vgpr1, implicit $m0, implicit $exec, implicit-def $vgpr1_vgpr2, implicit undef $vgpr1_vgpr2(tied-def 4)
  ; CHECK-NEXT:   $vgpr3 = V_ADD_U32_e32 $vgpr2, $vgpr1, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr3
  bb.0:
    liveins: $vgpr0, $vgpr2
    $m0 = S_MOV_B32 0
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    V_MOVRELD_B32_e32 $vgpr2, $vgpr1, implicit $m0, implicit $exec, implicit-def $vgpr1_vgpr2, implicit undef $vgpr1_vgpr2(tied-def 4)
    $vgpr3 = V_ADD_U32_e32 $vgpr2, $vgpr1, implicit $exec
  bb.1:
    liveins: $vgpr3
...

# Invalid producers and invalid consumer opcodes.
---
name: v_writelane_b32
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: v_writelane_b32
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0, $sgpr0
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT:   $vgpr1 = V_WRITELANE_B32 $sgpr0, 0, $vgpr1
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr2 = V_MOV_B32_e32 $vgpr1, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr0
  bb.0:
    liveins: $vgpr0, $sgpr0
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
    $vgpr1 = V_WRITELANE_B32 $sgpr0, 0, $vgpr1
    $vgpr2 = V_MOV_B32_e32 $vgpr1, implicit $exec
  bb.1:
    liveins: $vgpr0
...

# DPP instructions cannot be single use producers or consumers
---
name: V_ADD_NC_U32_dpp
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: V_ADD_NC_U32_dpp
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT:   liveins: $vgpr0, $vcc
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   $vgpr0 = V_ADDC_U32_dpp $vgpr0, $vgpr0, $vgpr0, 1, 15, 15, 1, implicit-def $vcc_lo, implicit $vcc_lo, implicit $exec
  ; CHECK-NEXT:   $vgpr0 = V_ADDC_U32_dpp $vgpr0, $vgpr0, $vgpr0, 1, 15, 15, 1, implicit-def $vcc_lo, implicit $vcc_lo, implicit $exec
  ; CHECK-NEXT:   $vgpr0 = V_ADDC_U32_dpp $vgpr0, $vgpr0, $vgpr0, 1, 15, 15, 1, implicit-def $vcc_lo, implicit $vcc_lo, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr0
  bb.0:
    liveins: $vgpr0, $vcc
    $vgpr0 = V_ADDC_U32_dpp $vgpr0, $vgpr0, $vgpr0, 1, 15, 15, 1, implicit-def $vcc, implicit $vcc, implicit $exec
    $vgpr0 = V_ADDC_U32_dpp $vgpr0, $vgpr0, $vgpr0, 1, 15, 15, 1, implicit-def $vcc, implicit $vcc, implicit $exec
    $vgpr0 = V_ADDC_U32_dpp $vgpr0, $vgpr0, $vgpr0, 1, 15, 15, 1, implicit-def $vcc, implicit $vcc, implicit $exec
  bb.1:
    liveins: $vgpr0
...

# Exception to the rule that dpp instructions
# cannot be single use producers or consumers
---
name: V_INTERP_MOV_F32
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: V_INTERP_MOV_F32
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   S_SINGLEUSE_VDST 1
  ; CHECK-NEXT:   $vgpr0 = V_INTERP_MOV_F32 0, 0, 0, implicit $mode, implicit $m0, implicit $exec
  ; CHECK-NEXT:   $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   liveins: $vgpr1
  bb.0:
    $vgpr0 = V_INTERP_MOV_F32 0, 0, 0, implicit $mode, implicit $m0, implicit $exec
    $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
  bb.1:
    liveins: $vgpr1
...