llvm/llvm/test/CodeGen/AMDGPU/shrink-mad-fma.mir

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -run-pass si-shrink-instructions -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=GFX10
# RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -run-pass si-shrink-instructions -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=GFX11

---
name: mad_cvv_f32
body: |
  bb.0:
    ; GFX10-LABEL: name: mad_cvv_f32
    ; GFX10: $vgpr0 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr2 = V_MADMK_F32 $vgpr0, 1092616192, $vgpr1, implicit $mode, implicit $exec
    ; GFX10-NEXT: SI_RETURN implicit $vgpr2
    ;
    ; GFX11-LABEL: name: mad_cvv_f32
    ; GFX11: $vgpr0 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr2 = V_MADMK_F32 $vgpr0, 1092616192, $vgpr1, implicit $mode, implicit $exec
    ; GFX11-NEXT: SI_RETURN implicit $vgpr2
    $vgpr0 = IMPLICIT_DEF
    $vgpr1 = IMPLICIT_DEF
    $vgpr2 = V_MAD_F32_e64 0, 1092616192, 0, $vgpr0, 0, $vgpr1, 0, 0, implicit $mode, implicit $exec
    SI_RETURN implicit $vgpr2
...

---
name: mad_vcv_f32
body: |
  bb.0:
    ; GFX10-LABEL: name: mad_vcv_f32
    ; GFX10: $vgpr0 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr2 = V_MADMK_F32 $vgpr0, 1092616192, $vgpr1, implicit $mode, implicit $exec
    ; GFX10-NEXT: SI_RETURN implicit $vgpr2
    ;
    ; GFX11-LABEL: name: mad_vcv_f32
    ; GFX11: $vgpr0 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr2 = V_MADMK_F32 $vgpr0, 1092616192, $vgpr1, implicit $mode, implicit $exec
    ; GFX11-NEXT: SI_RETURN implicit $vgpr2
    $vgpr0 = IMPLICIT_DEF
    $vgpr1 = IMPLICIT_DEF
    $vgpr2 = V_MAD_F32_e64 0, $vgpr0, 0, 1092616192, 0, $vgpr1, 0, 0, implicit $mode, implicit $exec
    SI_RETURN implicit $vgpr2
...

---
name: mad_vvc_f32
body: |
  bb.0:
    ; GFX10-LABEL: name: mad_vvc_f32
    ; GFX10: $vgpr0 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr2 = V_MADAK_F32 $vgpr0, $vgpr1, 1092616192, implicit $mode, implicit $exec
    ; GFX10-NEXT: SI_RETURN implicit $vgpr2
    ;
    ; GFX11-LABEL: name: mad_vvc_f32
    ; GFX11: $vgpr0 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr2 = V_MADAK_F32 $vgpr0, $vgpr1, 1092616192, implicit $mode, implicit $exec
    ; GFX11-NEXT: SI_RETURN implicit $vgpr2
    $vgpr0 = IMPLICIT_DEF
    $vgpr1 = IMPLICIT_DEF
    $vgpr2 = V_MAD_F32_e64 0, $vgpr0, 0, $vgpr1, 0, 1092616192, 0, 0, implicit $mode, implicit $exec
    SI_RETURN implicit $vgpr2
...

---
name: mad_vsc_f32
body: |
  bb.0:
    ; GFX10-LABEL: name: mad_vsc_f32
    ; GFX10: $vgpr0 = IMPLICIT_DEF
    ; GFX10-NEXT: $sgpr1 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr2 = V_MADAK_F32 $vgpr0, $vgpr1, 1092616192, implicit $mode, implicit $exec
    ; GFX10-NEXT: SI_RETURN implicit $vgpr2
    ;
    ; GFX11-LABEL: name: mad_vsc_f32
    ; GFX11: $vgpr0 = IMPLICIT_DEF
    ; GFX11-NEXT: $sgpr1 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr2 = V_MADAK_F32 $vgpr0, $vgpr1, 1092616192, implicit $mode, implicit $exec
    ; GFX11-NEXT: SI_RETURN implicit $vgpr2
    $vgpr0 = IMPLICIT_DEF
    $sgpr1 = IMPLICIT_DEF
    $vgpr2 = V_MAD_F32_e64 0, $vgpr0, 0, $vgpr1, 0, 1092616192, 0, 0, implicit $mode, implicit $exec
    SI_RETURN implicit $vgpr2
...

---
name: fma_cvv_f32
body: |
  bb.0:
    ; GFX10-LABEL: name: fma_cvv_f32
    ; GFX10: $vgpr0 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr2 = V_FMAMK_F32 $vgpr0, 1092616192, $vgpr1, implicit $mode, implicit $exec
    ; GFX10-NEXT: SI_RETURN implicit $vgpr2
    ;
    ; GFX11-LABEL: name: fma_cvv_f32
    ; GFX11: $vgpr0 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr2 = V_FMAMK_F32 $vgpr0, 1092616192, $vgpr1, implicit $mode, implicit $exec
    ; GFX11-NEXT: SI_RETURN implicit $vgpr2
    $vgpr0 = IMPLICIT_DEF
    $vgpr1 = IMPLICIT_DEF
    $vgpr2 = V_FMA_F32_e64 0, 1092616192, 0, $vgpr0, 0, $vgpr1, 0, 0, implicit $mode, implicit $exec
    SI_RETURN implicit $vgpr2
...

---
name: fma_vcv_f32
body: |
  bb.0:
    ; GFX10-LABEL: name: fma_vcv_f32
    ; GFX10: $vgpr0 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr2 = V_FMAMK_F32 $vgpr0, 1092616192, $vgpr1, implicit $mode, implicit $exec
    ; GFX10-NEXT: SI_RETURN implicit $vgpr2
    ;
    ; GFX11-LABEL: name: fma_vcv_f32
    ; GFX11: $vgpr0 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr2 = V_FMAMK_F32 $vgpr0, 1092616192, $vgpr1, implicit $mode, implicit $exec
    ; GFX11-NEXT: SI_RETURN implicit $vgpr2
    $vgpr0 = IMPLICIT_DEF
    $vgpr1 = IMPLICIT_DEF
    $vgpr2 = V_FMA_F32_e64 0, $vgpr0, 0, 1092616192, 0, $vgpr1, 0, 0, implicit $mode, implicit $exec
    SI_RETURN implicit $vgpr2
...

---
name: fma_vvc_f32
body: |
  bb.0:
    ; GFX10-LABEL: name: fma_vvc_f32
    ; GFX10: $vgpr0 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr2 = V_FMAAK_F32 $vgpr0, $vgpr1, 1092616192, implicit $mode, implicit $exec
    ; GFX10-NEXT: SI_RETURN implicit $vgpr2
    ;
    ; GFX11-LABEL: name: fma_vvc_f32
    ; GFX11: $vgpr0 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr2 = V_FMAAK_F32 $vgpr0, $vgpr1, 1092616192, implicit $mode, implicit $exec
    ; GFX11-NEXT: SI_RETURN implicit $vgpr2
    $vgpr0 = IMPLICIT_DEF
    $vgpr1 = IMPLICIT_DEF
    $vgpr2 = V_FMA_F32_e64 0, $vgpr0, 0, $vgpr1, 0, 1092616192, 0, 0, implicit $mode, implicit $exec
    SI_RETURN implicit $vgpr2
...

---
name: fma_vsc_f32
body: |
  bb.0:
    ; GFX10-LABEL: name: fma_vsc_f32
    ; GFX10: $vgpr0 = IMPLICIT_DEF
    ; GFX10-NEXT: $sgpr1 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr2 = V_FMAAK_F32 $vgpr0, $vgpr1, 1092616192, implicit $mode, implicit $exec
    ; GFX10-NEXT: SI_RETURN implicit $vgpr2
    ;
    ; GFX11-LABEL: name: fma_vsc_f32
    ; GFX11: $vgpr0 = IMPLICIT_DEF
    ; GFX11-NEXT: $sgpr1 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr2 = V_FMAAK_F32 $vgpr0, $vgpr1, 1092616192, implicit $mode, implicit $exec
    ; GFX11-NEXT: SI_RETURN implicit $vgpr2
    $vgpr0 = IMPLICIT_DEF
    $sgpr1 = IMPLICIT_DEF
    $vgpr2 = V_FMA_F32_e64 0, $vgpr0, 0, $vgpr1, 0, 1092616192, 0, 0, implicit $mode, implicit $exec
    SI_RETURN implicit $vgpr2
...

---
name: mad_cvv_f16
body: |
  bb.0:
    ; GFX10-LABEL: name: mad_cvv_f16
    ; GFX10: $vgpr0 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr2 = V_MADMK_F16 $vgpr0, 18688, $vgpr1, implicit $mode, implicit $exec
    ; GFX10-NEXT: SI_RETURN implicit $vgpr2
    ;
    ; GFX11-LABEL: name: mad_cvv_f16
    ; GFX11: $vgpr0 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr2 = V_MADMK_F16 $vgpr0, 18688, $vgpr1, implicit $mode, implicit $exec
    ; GFX11-NEXT: SI_RETURN implicit $vgpr2
    $vgpr0 = IMPLICIT_DEF
    $vgpr1 = IMPLICIT_DEF
    $vgpr2 = V_MAD_F16_e64 0, 18688, 0, $vgpr0, 0, $vgpr1, 0, 0, implicit $mode, implicit $exec
    SI_RETURN implicit $vgpr2
...

---
name: mad_vcv_f16
body: |
  bb.0:
    ; GFX10-LABEL: name: mad_vcv_f16
    ; GFX10: $vgpr0 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr2 = V_MADMK_F16 $vgpr0, 18688, $vgpr1, implicit $mode, implicit $exec
    ; GFX10-NEXT: SI_RETURN implicit $vgpr2
    ;
    ; GFX11-LABEL: name: mad_vcv_f16
    ; GFX11: $vgpr0 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr2 = V_MADMK_F16 $vgpr0, 18688, $vgpr1, implicit $mode, implicit $exec
    ; GFX11-NEXT: SI_RETURN implicit $vgpr2
    $vgpr0 = IMPLICIT_DEF
    $vgpr1 = IMPLICIT_DEF
    $vgpr2 = V_MAD_F16_e64 0, $vgpr0, 0, 18688, 0, $vgpr1, 0, 0, implicit $mode, implicit $exec
    SI_RETURN implicit $vgpr2
...

---
name: mad_vvc_f16
body: |
  bb.0:
    ; GFX10-LABEL: name: mad_vvc_f16
    ; GFX10: $vgpr0 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr2 = V_MADAK_F16 $vgpr0, $vgpr1, 18688, implicit $mode, implicit $exec
    ; GFX10-NEXT: SI_RETURN implicit $vgpr2
    ;
    ; GFX11-LABEL: name: mad_vvc_f16
    ; GFX11: $vgpr0 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr2 = V_MADAK_F16 $vgpr0, $vgpr1, 18688, implicit $mode, implicit $exec
    ; GFX11-NEXT: SI_RETURN implicit $vgpr2
    $vgpr0 = IMPLICIT_DEF
    $vgpr1 = IMPLICIT_DEF
    $vgpr2 = V_MAD_F16_e64 0, $vgpr0, 0, $vgpr1, 0, 18688, 0, 0, implicit $mode, implicit $exec
    SI_RETURN implicit $vgpr2
...

---
name: mad_vsc_f16
body: |
  bb.0:
    ; GFX10-LABEL: name: mad_vsc_f16
    ; GFX10: $vgpr0 = IMPLICIT_DEF
    ; GFX10-NEXT: $sgpr1 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr2 = V_MADAK_F16 $vgpr0, $vgpr1, 18688, implicit $mode, implicit $exec
    ; GFX10-NEXT: SI_RETURN implicit $vgpr2
    ;
    ; GFX11-LABEL: name: mad_vsc_f16
    ; GFX11: $vgpr0 = IMPLICIT_DEF
    ; GFX11-NEXT: $sgpr1 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr2 = V_MADAK_F16 $vgpr0, $vgpr1, 18688, implicit $mode, implicit $exec
    ; GFX11-NEXT: SI_RETURN implicit $vgpr2
    $vgpr0 = IMPLICIT_DEF
    $sgpr1 = IMPLICIT_DEF
    $vgpr2 = V_MAD_F16_e64 0, $vgpr0, 0, $vgpr1, 0, 18688, 0, 0, implicit $mode, implicit $exec
    SI_RETURN implicit $vgpr2
...

---
name: fma_cvv_f16
body: |
  bb.0:
    ; GFX10-LABEL: name: fma_cvv_f16
    ; GFX10: $vgpr0 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr2 = V_FMAMK_F16 $vgpr0, 18688, $vgpr1, implicit $mode, implicit $exec
    ; GFX10-NEXT: SI_RETURN implicit $vgpr2
    ;
    ; GFX11-LABEL: name: fma_cvv_f16
    ; GFX11: $vgpr0 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr2 = V_FMAMK_F16_t16 $vgpr0, 18688, $vgpr1, implicit $mode, implicit $exec
    ; GFX11-NEXT: SI_RETURN implicit $vgpr2
    $vgpr0 = IMPLICIT_DEF
    $vgpr1 = IMPLICIT_DEF
    $vgpr2 = V_FMA_F16_gfx9_e64 0, 18688, 0, $vgpr0, 0, $vgpr1, 0, 0, 0, implicit $mode, implicit $exec
    SI_RETURN implicit $vgpr2
...

---
name: fma_vcv_f16
body: |
  bb.0:
    ; GFX10-LABEL: name: fma_vcv_f16
    ; GFX10: $vgpr0 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr2 = V_FMAMK_F16 $vgpr0, 18688, $vgpr1, implicit $mode, implicit $exec
    ; GFX10-NEXT: SI_RETURN implicit $vgpr2
    ;
    ; GFX11-LABEL: name: fma_vcv_f16
    ; GFX11: $vgpr0 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr2 = V_FMAMK_F16_t16 $vgpr0, 18688, $vgpr1, implicit $mode, implicit $exec
    ; GFX11-NEXT: SI_RETURN implicit $vgpr2
    $vgpr0 = IMPLICIT_DEF
    $vgpr1 = IMPLICIT_DEF
    $vgpr2 = V_FMA_F16_gfx9_e64 0, $vgpr0, 0, 18688, 0, $vgpr1, 0, 0, 0, implicit $mode, implicit $exec
    SI_RETURN implicit $vgpr2
...

---
name: fma_vvc_f16
body: |
  bb.0:
    ; GFX10-LABEL: name: fma_vvc_f16
    ; GFX10: $vgpr0 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr2 = V_FMAAK_F16 $vgpr0, $vgpr1, 18688, implicit $mode, implicit $exec
    ; GFX10-NEXT: SI_RETURN implicit $vgpr2
    ;
    ; GFX11-LABEL: name: fma_vvc_f16
    ; GFX11: $vgpr0 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr1 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr2 = V_FMAAK_F16_t16 $vgpr0, $vgpr1, 18688, implicit $mode, implicit $exec
    ; GFX11-NEXT: SI_RETURN implicit $vgpr2
    $vgpr0 = IMPLICIT_DEF
    $vgpr1 = IMPLICIT_DEF
    $vgpr2 = V_FMA_F16_gfx9_e64 0, $vgpr0, 0, $vgpr1, 0, 18688, 0, 0, 0, implicit $mode, implicit $exec
    SI_RETURN implicit $vgpr2
...

---
name: fma_vsc_f16
body: |
  bb.0:
    ; GFX10-LABEL: name: fma_vsc_f16
    ; GFX10: $vgpr0 = IMPLICIT_DEF
    ; GFX10-NEXT: $sgpr1 = IMPLICIT_DEF
    ; GFX10-NEXT: $vgpr2 = V_FMAAK_F16 $vgpr0, $vgpr1, 18688, implicit $mode, implicit $exec
    ; GFX10-NEXT: SI_RETURN implicit $vgpr2
    ;
    ; GFX11-LABEL: name: fma_vsc_f16
    ; GFX11: $vgpr0 = IMPLICIT_DEF
    ; GFX11-NEXT: $sgpr1 = IMPLICIT_DEF
    ; GFX11-NEXT: $vgpr2 = V_FMAAK_F16_t16 $vgpr0, $vgpr1, 18688, implicit $mode, implicit $exec
    ; GFX11-NEXT: SI_RETURN implicit $vgpr2
    $vgpr0 = IMPLICIT_DEF
    $sgpr1 = IMPLICIT_DEF
    $vgpr2 = V_FMA_F16_gfx9_e64 0, $vgpr0, 0, $vgpr1, 0, 18688, 0, 0, 0, implicit $mode, implicit $exec
    SI_RETURN implicit $vgpr2
...