1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -run-pass=legalizer %s -o - | FileCheck %s
3
4---
5name: test_flog2_s32
6body: |
7  bb.0:
8    liveins: $vgpr0
9
10    ; CHECK-LABEL: name: test_flog2_s32
11    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
12    ; CHECK: [[FLOG2_:%[0-9]+]]:_(s32) = G_FLOG2 [[COPY]]
13    ; CHECK: $vgpr0 = COPY [[FLOG2_]](s32)
14    %0:_(s32) = COPY $vgpr0
15    %1:_(s32) = G_FLOG2 %0
16    $vgpr0 = COPY %1
17...
18
19---
20name: test_flog2_v2s32
21body: |
22  bb.0:
23    liveins: $vgpr0_vgpr1
24
25    ; CHECK-LABEL: name: test_flog2_v2s32
26    ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
27    ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
28    ; CHECK: [[FLOG2_:%[0-9]+]]:_(s32) = G_FLOG2 [[UV]]
29    ; CHECK: [[FLOG2_1:%[0-9]+]]:_(s32) = G_FLOG2 [[UV1]]
30    ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[FLOG2_]](s32), [[FLOG2_1]](s32)
31    ; CHECK: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
32    %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
33    %1:_(<2 x s32>) = G_FLOG2 %0
34    $vgpr0_vgpr1 = COPY %1
35...
36
37---
38name: test_flog2_v3s32
39body: |
40  bb.0:
41    liveins: $vgpr0_vgpr1_vgpr2
42
43    ; CHECK-LABEL: name: test_flog2_v3s32
44    ; CHECK: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
45    ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<3 x s32>)
46    ; CHECK: [[FLOG2_:%[0-9]+]]:_(s32) = G_FLOG2 [[UV]]
47    ; CHECK: [[FLOG2_1:%[0-9]+]]:_(s32) = G_FLOG2 [[UV1]]
48    ; CHECK: [[FLOG2_2:%[0-9]+]]:_(s32) = G_FLOG2 [[UV2]]
49    ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[FLOG2_]](s32), [[FLOG2_1]](s32), [[FLOG2_2]](s32)
50    ; CHECK: $vgpr0_vgpr1_vgpr2 = COPY [[BUILD_VECTOR]](<3 x s32>)
51    %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
52    %1:_(<3 x  s32>) = G_FLOG2 %0
53    $vgpr0_vgpr1_vgpr2 = COPY %1
54...
55