1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -O0 -run-pass=legalizer %s -o - | FileCheck %s
3
4---
5name: test_smulh_s32
6body: |
7  bb.0:
8    liveins: $vgpr0, $vgpr1
9
10    ; CHECK-LABEL: name: test_smulh_s32
11    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
12    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
13    ; CHECK: [[SMULH:%[0-9]+]]:_(s32) = G_SMULH [[COPY]], [[COPY1]]
14    ; CHECK: $vgpr0 = COPY [[SMULH]](s32)
15    %0:_(s32) = COPY $vgpr0
16    %1:_(s32) = COPY $vgpr1
17    %2:_(s32) = G_SMULH %0, %1
18    $vgpr0 = COPY %2
19...
20
21---
22name: test_smulh_v2s32
23body: |
24  bb.0:
25    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
26
27    ; CHECK-LABEL: name: test_smulh_v2s32
28    ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
29    ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
30    ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
31    ; CHECK: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
32    ; CHECK: [[SMULH:%[0-9]+]]:_(s32) = G_SMULH [[UV]], [[UV2]]
33    ; CHECK: [[SMULH1:%[0-9]+]]:_(s32) = G_SMULH [[UV1]], [[UV3]]
34    ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SMULH]](s32), [[SMULH1]](s32)
35    ; CHECK: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
36    %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
37    %1:_(<2 x s32>) = COPY $vgpr2_vgpr3
38    %2:_(<2 x s32>) = G_SMULH %0, %1
39    $vgpr0_vgpr1 = COPY %2
40...
41