llvm/llvm/test/CodeGen/AMDGPU/insert-delay-alu-literal.mir

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
# RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize64 -verify-machineinstrs -run-pass=amdgpu-insert-delay-alu %s -o - | FileCheck %s

---
name: valu_dep_1
body: |
  bb.0:
    ; CHECK-LABEL: name: valu_dep_1
    ; CHECK: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    ; CHECK-NEXT: S_DELAY_ALU .id0_VALU_DEP_1
    ; CHECK-NEXT: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
...

---
name: valu_dep_2
body: |
  bb.0:
    ; CHECK-LABEL: name: valu_dep_2
    ; CHECK: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    ; CHECK-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr1, $vgpr1, implicit $exec
    ; CHECK-NEXT: S_DELAY_ALU .id0_VALU_DEP_2
    ; CHECK-NEXT: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr1 = V_ADD_U32_e32 $vgpr1, $vgpr1, implicit $exec
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
...

---
name: valu_dep_3
body: |
  bb.0:
    ; CHECK-LABEL: name: valu_dep_3
    ; CHECK: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    ; CHECK-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr1, $vgpr1, implicit $exec
    ; CHECK-NEXT: $vgpr2 = V_ADD_U32_e32 $vgpr2, $vgpr2, implicit $exec
    ; CHECK-NEXT: S_DELAY_ALU .id0_VALU_DEP_3
    ; CHECK-NEXT: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr1 = V_ADD_U32_e32 $vgpr1, $vgpr1, implicit $exec
    $vgpr2 = V_ADD_U32_e32 $vgpr2, $vgpr2, implicit $exec
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
...

---
name: valu_dep_4
body: |
  bb.0:
    ; CHECK-LABEL: name: valu_dep_4
    ; CHECK: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    ; CHECK-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr1, $vgpr1, implicit $exec
    ; CHECK-NEXT: $vgpr2 = V_ADD_U32_e32 $vgpr2, $vgpr2, implicit $exec
    ; CHECK-NEXT: $vgpr3 = V_ADD_U32_e32 $vgpr3, $vgpr3, implicit $exec
    ; CHECK-NEXT: S_DELAY_ALU .id0_VALU_DEP_4
    ; CHECK-NEXT: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr1 = V_ADD_U32_e32 $vgpr1, $vgpr1, implicit $exec
    $vgpr2 = V_ADD_U32_e32 $vgpr2, $vgpr2, implicit $exec
    $vgpr3 = V_ADD_U32_e32 $vgpr3, $vgpr3, implicit $exec
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
...

---
name: trans32_dep_1
body: |
  bb.0:
    ; CHECK-LABEL: name: trans32_dep_1
    ; CHECK: $vgpr0 = V_EXP_F32_e32 $vgpr0, implicit $exec, implicit $mode
    ; CHECK-NEXT: S_DELAY_ALU .id0_TRANS32_DEP_1
    ; CHECK-NEXT: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr0 = V_EXP_F32_e32 $vgpr0, implicit $exec, implicit $mode
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
...

---
name: trans32_dep_2
body: |
  bb.0:
    ; CHECK-LABEL: name: trans32_dep_2
    ; CHECK: $vgpr0 = V_EXP_F32_e32 $vgpr0, implicit $exec, implicit $mode
    ; CHECK-NEXT: $vgpr1 = V_EXP_F32_e32 $vgpr1, implicit $exec, implicit $mode
    ; CHECK-NEXT: S_DELAY_ALU .id0_TRANS32_DEP_2
    ; CHECK-NEXT: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr0 = V_EXP_F32_e32 $vgpr0, implicit $exec, implicit $mode
    $vgpr1 = V_EXP_F32_e32 $vgpr1, implicit $exec, implicit $mode
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
...

---
name: trans32_dep_3
body: |
  bb.0:
    ; CHECK-LABEL: name: trans32_dep_3
    ; CHECK: $vgpr0 = V_EXP_F32_e32 $vgpr0, implicit $exec, implicit $mode
    ; CHECK-NEXT: $vgpr1 = V_EXP_F32_e32 $vgpr1, implicit $exec, implicit $mode
    ; CHECK-NEXT: $vgpr2 = V_EXP_F32_e32 $vgpr2, implicit $exec, implicit $mode
    ; CHECK-NEXT: S_DELAY_ALU .id0_TRANS32_DEP_3
    ; CHECK-NEXT: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr0 = V_EXP_F32_e32 $vgpr0, implicit $exec, implicit $mode
    $vgpr1 = V_EXP_F32_e32 $vgpr1, implicit $exec, implicit $mode
    $vgpr2 = V_EXP_F32_e32 $vgpr2, implicit $exec, implicit $mode
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
...

---
name: salu_cycle_1
body: |
  bb.0:
    ; CHECK-LABEL: name: salu_cycle_1
    ; CHECK: $sgpr0 = S_MOV_B32 0
    ; CHECK-NEXT: S_DELAY_ALU .id0_SALU_CYCLE_1
    ; CHECK-NEXT: $vgpr0 = V_ADD_U32_e32 $sgpr0, $vgpr0, implicit $exec
    $sgpr0 = S_MOV_B32 0
    $vgpr0 = V_ADD_U32_e32 $sgpr0, $vgpr0, implicit $exec
...

---
name: valu_dep_1_same_trans32_dep_1
body: |
  bb.0:
    ; CHECK-LABEL: name: valu_dep_1_same_trans32_dep_1
    ; CHECK: $vgpr0 = V_EXP_F32_e32 $vgpr0, implicit $exec, implicit $mode
    ; CHECK-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr1, $vgpr1, implicit $exec
    ; CHECK-NEXT: S_DELAY_ALU .id0_TRANS32_DEP_1_skip_SAME_id1_VALU_DEP_1
    ; CHECK-NEXT: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr1, implicit $exec
    $vgpr0 = V_EXP_F32_e32 $vgpr0, implicit $exec, implicit $mode
    $vgpr1 = V_ADD_U32_e32 $vgpr1, $vgpr1, implicit $exec
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr1, implicit $exec
...

---
name: valu_dep_1_same_salu_cycle_1
body: |
  bb.0:
    ; CHECK-LABEL: name: valu_dep_1_same_salu_cycle_1
    ; CHECK: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    ; CHECK-NEXT: $sgpr0 = S_MOV_B32 0
    ; CHECK-NEXT: S_DELAY_ALU .id0_VALU_DEP_1_skip_SAME_id1_SALU_CYCLE_1
    ; CHECK-NEXT: $vgpr0 = V_ADD_U32_e32 $sgpr0, $vgpr0, implicit $exec
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $sgpr0 = S_MOV_B32 0
    $vgpr0 = V_ADD_U32_e32 $sgpr0, $vgpr0, implicit $exec
...

---
name: valu_dep_1_next_valu_dep_1
body: |
  bb.0:
    ; CHECK-LABEL: name: valu_dep_1_next_valu_dep_1
    ; CHECK: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    ; CHECK-NEXT: S_DELAY_ALU .id0_VALU_DEP_1_skip_NEXT_id1_VALU_DEP_1
    ; CHECK-NEXT: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    ; CHECK-NEXT: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
...

---
name: valu_dep_2_next_valu_dep_2
body: |
  bb.0:
    ; CHECK-LABEL: name: valu_dep_2_next_valu_dep_2
    ; CHECK: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    ; CHECK-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr1, $vgpr1, implicit $exec
    ; CHECK-NEXT: S_DELAY_ALU .id0_VALU_DEP_2_skip_NEXT_id1_VALU_DEP_2
    ; CHECK-NEXT: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    ; CHECK-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr1, $vgpr1, implicit $exec
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr1 = V_ADD_U32_e32 $vgpr1, $vgpr1, implicit $exec
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr1 = V_ADD_U32_e32 $vgpr1, $vgpr1, implicit $exec
...

---
name: valu_dep_2_skip_valu_dep_2
body: |
  bb.0:
    ; CHECK-LABEL: name: valu_dep_2_skip_valu_dep_2
    ; CHECK: $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    ; CHECK-NEXT: $vgpr2 = V_ADD_U32_e32 $vgpr1, $vgpr1, implicit $exec
    ; CHECK-NEXT: S_DELAY_ALU .id0_VALU_DEP_2_skip_SKIP_1_id1_VALU_DEP_2
    ; CHECK-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr1, implicit $exec
    ; CHECK-NEXT: $vgpr4 = V_ADD_U32_e32 $vgpr3, $vgpr3, implicit $exec
    ; CHECK-NEXT: $vgpr1 = V_ADD_U32_e32 $vgpr1, $vgpr1, implicit $exec
    $vgpr0 = V_ADD_U32_e32 $vgpr0, $vgpr0, implicit $exec
    $vgpr2 = V_ADD_U32_e32 $vgpr1, $vgpr1, implicit $exec
    $vgpr1 = V_ADD_U32_e32 $vgpr0, $vgpr1, implicit $exec
    $vgpr4 = V_ADD_U32_e32 $vgpr3, $vgpr3, implicit $exec
    $vgpr1 = V_ADD_U32_e32 $vgpr1, $vgpr1, implicit $exec
...