1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -run-pass=amdgpu-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s
8 liveins: $vgpr0, $vgpr1
10 ; CHECK-LABEL: name: test_add_rhs
11 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
12 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
13 ; CHECK-NEXT: [[FSUB:%[0-9]+]]:_(s32) = G_FSUB [[COPY]], [[COPY1]]
14 ; CHECK-NEXT: $vgpr0 = COPY [[FSUB]](s32)
15 %0:_(s32) = COPY $vgpr0
16 %1:_(s32) = COPY $vgpr1
18 %3:_(s32) = G_FADD %0, %2
26 liveins: $vgpr0, $vgpr1
28 ; CHECK-LABEL: name: test_add_lhs
29 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
30 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
31 ; CHECK-NEXT: [[FSUB:%[0-9]+]]:_(s32) = G_FSUB [[COPY1]], [[COPY]]
32 ; CHECK-NEXT: $vgpr0 = COPY [[FSUB]](s32)
33 %0:_(s32) = COPY $vgpr0
34 %1:_(s32) = COPY $vgpr1
36 %3:_(s32) = G_FADD %2, %1
44 liveins: $vgpr0, $vgpr1
46 ; CHECK-LABEL: name: test_sub
47 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
48 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
49 ; CHECK-NEXT: [[FADD:%[0-9]+]]:_(s32) = G_FADD [[COPY]], [[COPY1]]
50 ; CHECK-NEXT: $vgpr0 = COPY [[FADD]](s32)
51 %0:_(s32) = COPY $vgpr0
52 %1:_(s32) = COPY $vgpr1
54 %3:_(s32) = G_FSUB %0, %2
62 liveins: $vgpr0, $vgpr1
64 ; CHECK-LABEL: name: test_mul
65 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
66 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
67 ; CHECK-NEXT: [[FMUL:%[0-9]+]]:_(s32) = G_FMUL [[COPY]], [[COPY1]]
68 ; CHECK-NEXT: $vgpr0 = COPY [[FMUL]](s32)
69 %0:_(s32) = COPY $vgpr0
70 %1:_(s32) = COPY $vgpr1
73 %4:_(s32) = G_FMUL %2, %3
81 liveins: $vgpr0, $vgpr1
83 ; CHECK-LABEL: name: test_div
84 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
85 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
86 ; CHECK-NEXT: [[FDIV:%[0-9]+]]:_(s32) = G_FDIV [[COPY]], [[COPY1]]
87 ; CHECK-NEXT: $vgpr0 = COPY [[FDIV]](s32)
88 %0:_(s32) = COPY $vgpr0
89 %1:_(s32) = COPY $vgpr1
92 %4:_(s32) = G_FDIV %2, %3
100 liveins: $vgpr0, $vgpr1, $vgpr2
102 ; CHECK-LABEL: name: test_fmad
103 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
104 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
105 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
106 ; CHECK-NEXT: [[FMAD:%[0-9]+]]:_(s32) = G_FMAD [[COPY]], [[COPY1]], [[COPY2]]
107 ; CHECK-NEXT: $vgpr0 = COPY [[FMAD]](s32)
108 %0:_(s32) = COPY $vgpr0
109 %1:_(s32) = COPY $vgpr1
110 %2:_(s32) = COPY $vgpr2
111 %3:_(s32) = G_FNEG %0
112 %4:_(s32) = G_FNEG %1
113 %5:_(s32) = G_FMAD %3, %4, %2
114 $vgpr0 = COPY %5(s32)
121 liveins: $vgpr0, $vgpr1, $vgpr2
123 ; CHECK-LABEL: name: test_fma
124 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
125 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
126 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
127 ; CHECK-NEXT: [[FMA:%[0-9]+]]:_(s32) = G_FMA [[COPY]], [[COPY1]], [[COPY2]]
128 ; CHECK-NEXT: $vgpr0 = COPY [[FMA]](s32)
129 %0:_(s32) = COPY $vgpr0
130 %1:_(s32) = COPY $vgpr1
131 %2:_(s32) = COPY $vgpr2
132 %3:_(s32) = G_FNEG %0
133 %4:_(s32) = G_FNEG %1
134 %5:_(s32) = G_FMA %3, %4, %2
135 $vgpr0 = COPY %5(s32)