Skip to content

Commit b3ab5b7

Browse files
committed
fixup! Address code review comments and test failures
1 parent f0ff4d6 commit b3ab5b7

File tree

7 files changed

+205
-17
lines changed

7 files changed

+205
-17
lines changed

llvm/include/llvm-c/Core.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -386,19 +386,19 @@ typedef enum {
386386
LLVMAtomicRMWBinOpFMin, /**< Sets the value if it's smaller than the
387387
original using an floating point comparison and
388388
return the old one */
389-
LLVMAtomicRMWBinOpFMaximum, /**< Sets the value if it's greater than the
390-
original using an floating point comparison and
391-
return the old one */
392-
LLVMAtomicRMWBinOpFMinimum, /**< Sets the value if it's smaller than the
393-
original using an floating point comparison and
394-
return the old one */
395389
LLVMAtomicRMWBinOpUIncWrap, /**< Increments the value, wrapping back to zero
396390
when incremented above input value */
397391
LLVMAtomicRMWBinOpUDecWrap, /**< Decrements the value, wrapping back to
398392
the input value when decremented below zero */
399393
LLVMAtomicRMWBinOpUSubCond, /**<Subtracts the value only if no unsigned
400394
overflow */
401395
LLVMAtomicRMWBinOpUSubSat, /**<Subtracts the value, clamping to zero */
396+
LLVMAtomicRMWBinOpFMaximum, /**< Sets the value if it's greater than the
397+
original using an floating point comparison and
398+
return the old one */
399+
LLVMAtomicRMWBinOpFMinimum, /**< Sets the value if it's smaller than the
400+
original using an floating point comparison and
401+
return the old one */
402402
} LLVMAtomicRMWBinOp;
403403

404404
typedef enum {

llvm/lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@ bool isSaturating(AtomicRMWInst& RMWI) {
6868
case AtomicRMWInst::FMin:
6969
// minnum(x, -inf) -> +inf
7070
return CF->isNegative() && CF->isInfinity();
71-
case AtomicRMWInst::FMaximum:
72-
// maximum(x, +inf) -> +inf
73-
return !CF->isNegative() && CF->isInfinity();
74-
case AtomicRMWInst::FMinimum:
75-
// minimum(x, -inf) -> +inf
76-
return CF->isNegative() && CF->isInfinity();
7771
case AtomicRMWInst::FAdd:
7872
case AtomicRMWInst::FSub:
7973
return CF->isNaN();

llvm/test/Assembler/atomic.ll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,11 @@ define void @fp_vector_atomicrmw(ptr %x, <2 x half> %val) {
108108
; CHECK: %atomic.fmin = atomicrmw fmin ptr %x, <2 x half> %val seq_cst
109109
%atomic.fmin = atomicrmw fmin ptr %x, <2 x half> %val seq_cst
110110

111+
; CHECK: %atomic.fmaximum = atomicrmw fmaximum ptr %x, <2 x half> %val seq_cst
112+
%atomic.fmaximum = atomicrmw fmaximum ptr %x, <2 x half> %val seq_cst
113+
114+
; CHECK: %atomic.fminimum = atomicrmw fminimum ptr %x, <2 x half> %val seq_cst
115+
%atomic.fminimum = atomicrmw fminimum ptr %x, <2 x half> %val seq_cst
116+
111117
ret void
112118
}

llvm/test/CodeGen/RISCV/GlobalISel/legalizer-info-validation.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@
585585
# DEBUG-NEXT: .. type index coverage check SKIPPED: no rules defined
586586
# DEBUG-NEXT: .. imm index coverage check SKIPPED: no rules defined
587587
# DEBUG-NEXT: G_FMINIMUM (opcode {{[0-9]+}}): 1 type index
588-
# DEBUG-NEXT: .. opcode 212 is aliased to 213
588+
# DEBUG-NEXT: .. opcode {{[0-9]+}} is aliased to {{[0-9]+}}
589589
# DEBUG-NEXT: .. type index coverage check SKIPPED: no rules defined
590590
# DEBUG-NEXT: .. imm index coverage check SKIPPED: no rules defined
591591
# DEBUG-NEXT: G_FMAXIMUM (opcode {{[0-9]+}}): 1 type index

llvm/test/Transforms/AtomicExpand/AArch64/atomicrmw-fp.ll

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,170 @@ define float @test_atomicrmw_fsub_f32(ptr %ptr, float %value) {
4343
ret float %res
4444
}
4545

46+
define float @atomicrmw_fmin_float(ptr %ptr, float %value) {
47+
; CHECK-LABEL: @atomicrmw_fmin_float(
48+
; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr [[PTR:%.*]], align 4
49+
; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]]
50+
; CHECK: atomicrmw.start:
51+
; CHECK-NEXT: [[LOADED:%.*]] = phi float [ [[TMP1]], [[TMP0:%.*]] ], [ [[TMP6:%.*]], [[ATOMICRMW_START]] ]
52+
; CHECK-NEXT: [[TMP2:%.*]] = call float @llvm.minnum.f32(float [[LOADED]], float [[VALUE:%.*]])
53+
; CHECK-NEXT: [[TMP3:%.*]] = bitcast float [[TMP2]] to i32
54+
; CHECK-NEXT: [[TMP4:%.*]] = bitcast float [[LOADED]] to i32
55+
; CHECK-NEXT: [[TMP5:%.*]] = cmpxchg ptr [[PTR]], i32 [[TMP4]], i32 [[TMP3]] seq_cst seq_cst, align 4
56+
; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP5]], 1
57+
; CHECK-NEXT: [[NEWLOADED:%.*]] = extractvalue { i32, i1 } [[TMP5]], 0
58+
; CHECK-NEXT: [[TMP6]] = bitcast i32 [[NEWLOADED]] to float
59+
; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]]
60+
; CHECK: atomicrmw.end:
61+
; CHECK-NEXT: ret float [[TMP6]]
62+
;
63+
%res = atomicrmw fmin ptr %ptr, float %value seq_cst
64+
ret float %res
65+
}
66+
67+
define float @atomicrmw_fmax_float(ptr %ptr, float %value) {
68+
; CHECK-LABEL: @atomicrmw_fmax_float(
69+
; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr [[PTR:%.*]], align 4
70+
; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]]
71+
; CHECK: atomicrmw.start:
72+
; CHECK-NEXT: [[LOADED:%.*]] = phi float [ [[TMP1]], [[TMP0:%.*]] ], [ [[TMP6:%.*]], [[ATOMICRMW_START]] ]
73+
; CHECK-NEXT: [[TMP2:%.*]] = call float @llvm.maxnum.f32(float [[LOADED]], float [[VALUE:%.*]])
74+
; CHECK-NEXT: [[TMP3:%.*]] = bitcast float [[TMP2]] to i32
75+
; CHECK-NEXT: [[TMP4:%.*]] = bitcast float [[LOADED]] to i32
76+
; CHECK-NEXT: [[TMP5:%.*]] = cmpxchg ptr [[PTR]], i32 [[TMP4]], i32 [[TMP3]] seq_cst seq_cst, align 4
77+
; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP5]], 1
78+
; CHECK-NEXT: [[NEWLOADED:%.*]] = extractvalue { i32, i1 } [[TMP5]], 0
79+
; CHECK-NEXT: [[TMP6]] = bitcast i32 [[NEWLOADED]] to float
80+
; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]]
81+
; CHECK: atomicrmw.end:
82+
; CHECK-NEXT: ret float [[TMP6]]
83+
;
84+
%res = atomicrmw fmax ptr %ptr, float %value seq_cst
85+
ret float %res
86+
}
87+
88+
define double @atomicrmw_fmin_double(ptr %ptr, double %value) {
89+
; CHECK-LABEL: @atomicrmw_fmin_double(
90+
; CHECK-NEXT: [[TMP1:%.*]] = load double, ptr [[PTR:%.*]], align 8
91+
; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]]
92+
; CHECK: atomicrmw.start:
93+
; CHECK-NEXT: [[LOADED:%.*]] = phi double [ [[TMP1]], [[TMP0:%.*]] ], [ [[TMP6:%.*]], [[ATOMICRMW_START]] ]
94+
; CHECK-NEXT: [[TMP2:%.*]] = call double @llvm.minnum.f64(double [[LOADED]], double [[VALUE:%.*]])
95+
; CHECK-NEXT: [[TMP3:%.*]] = bitcast double [[TMP2]] to i64
96+
; CHECK-NEXT: [[TMP4:%.*]] = bitcast double [[LOADED]] to i64
97+
; CHECK-NEXT: [[TMP5:%.*]] = cmpxchg ptr [[PTR]], i64 [[TMP4]], i64 [[TMP3]] seq_cst seq_cst, align 8
98+
; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP5]], 1
99+
; CHECK-NEXT: [[NEWLOADED:%.*]] = extractvalue { i64, i1 } [[TMP5]], 0
100+
; CHECK-NEXT: [[TMP6]] = bitcast i64 [[NEWLOADED]] to double
101+
; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]]
102+
; CHECK: atomicrmw.end:
103+
; CHECK-NEXT: ret double [[TMP6]]
104+
;
105+
%res = atomicrmw fmin ptr %ptr, double %value seq_cst
106+
ret double %res
107+
}
108+
109+
define double @atomicrmw_fmax_double(ptr %ptr, double %value) {
110+
; CHECK-LABEL: @atomicrmw_fmax_double(
111+
; CHECK-NEXT: [[TMP1:%.*]] = load double, ptr [[PTR:%.*]], align 8
112+
; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]]
113+
; CHECK: atomicrmw.start:
114+
; CHECK-NEXT: [[LOADED:%.*]] = phi double [ [[TMP1]], [[TMP0:%.*]] ], [ [[TMP6:%.*]], [[ATOMICRMW_START]] ]
115+
; CHECK-NEXT: [[TMP2:%.*]] = call double @llvm.maxnum.f64(double [[LOADED]], double [[VALUE:%.*]])
116+
; CHECK-NEXT: [[TMP3:%.*]] = bitcast double [[TMP2]] to i64
117+
; CHECK-NEXT: [[TMP4:%.*]] = bitcast double [[LOADED]] to i64
118+
; CHECK-NEXT: [[TMP5:%.*]] = cmpxchg ptr [[PTR]], i64 [[TMP4]], i64 [[TMP3]] seq_cst seq_cst, align 8
119+
; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP5]], 1
120+
; CHECK-NEXT: [[NEWLOADED:%.*]] = extractvalue { i64, i1 } [[TMP5]], 0
121+
; CHECK-NEXT: [[TMP6]] = bitcast i64 [[NEWLOADED]] to double
122+
; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]]
123+
; CHECK: atomicrmw.end:
124+
; CHECK-NEXT: ret double [[TMP6]]
125+
;
126+
%res = atomicrmw fmax ptr %ptr, double %value seq_cst
127+
ret double %res
128+
}
129+
130+
define float @atomicrmw_fminimum_float(ptr %ptr, float %value) {
131+
; CHECK-LABEL: @atomicrmw_fminimum_float(
132+
; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr [[PTR:%.*]], align 4
133+
; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]]
134+
; CHECK: atomicrmw.start:
135+
; CHECK-NEXT: [[LOADED:%.*]] = phi float [ [[TMP1]], [[TMP0:%.*]] ], [ [[TMP6:%.*]], [[ATOMICRMW_START]] ]
136+
; CHECK-NEXT: [[TMP2:%.*]] = call float @llvm.minimum.f32(float [[LOADED]], float [[VALUE:%.*]])
137+
; CHECK-NEXT: [[TMP3:%.*]] = bitcast float [[TMP2]] to i32
138+
; CHECK-NEXT: [[TMP4:%.*]] = bitcast float [[LOADED]] to i32
139+
; CHECK-NEXT: [[TMP5:%.*]] = cmpxchg ptr [[PTR]], i32 [[TMP4]], i32 [[TMP3]] seq_cst seq_cst, align 4
140+
; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP5]], 1
141+
; CHECK-NEXT: [[NEWLOADED:%.*]] = extractvalue { i32, i1 } [[TMP5]], 0
142+
; CHECK-NEXT: [[TMP6]] = bitcast i32 [[NEWLOADED]] to float
143+
; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]]
144+
; CHECK: atomicrmw.end:
145+
; CHECK-NEXT: ret float [[TMP6]]
146+
;
147+
%res = atomicrmw fminimum ptr %ptr, float %value seq_cst
148+
ret float %res
149+
}
150+
151+
define float @atomicrmw_fmaximum_float(ptr %ptr, float %value) {
152+
; CHECK-LABEL: @atomicrmw_fmaximum_float(
153+
; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr [[PTR:%.*]], align 4
154+
; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]]
155+
; CHECK: atomicrmw.start:
156+
; CHECK-NEXT: [[LOADED:%.*]] = phi float [ [[TMP1]], [[TMP0:%.*]] ], [ [[TMP6:%.*]], [[ATOMICRMW_START]] ]
157+
; CHECK-NEXT: [[TMP2:%.*]] = call float @llvm.maximum.f32(float [[LOADED]], float [[VALUE:%.*]])
158+
; CHECK-NEXT: [[TMP3:%.*]] = bitcast float [[TMP2]] to i32
159+
; CHECK-NEXT: [[TMP4:%.*]] = bitcast float [[LOADED]] to i32
160+
; CHECK-NEXT: [[TMP5:%.*]] = cmpxchg ptr [[PTR]], i32 [[TMP4]], i32 [[TMP3]] seq_cst seq_cst, align 4
161+
; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i32, i1 } [[TMP5]], 1
162+
; CHECK-NEXT: [[NEWLOADED:%.*]] = extractvalue { i32, i1 } [[TMP5]], 0
163+
; CHECK-NEXT: [[TMP6]] = bitcast i32 [[NEWLOADED]] to float
164+
; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]]
165+
; CHECK: atomicrmw.end:
166+
; CHECK-NEXT: ret float [[TMP6]]
167+
;
168+
%res = atomicrmw fmaximum ptr %ptr, float %value seq_cst
169+
ret float %res
170+
}
171+
172+
define double @atomicrmw_fminimum_double(ptr %ptr, double %value) {
173+
; CHECK-LABEL: @atomicrmw_fminimum_double(
174+
; CHECK-NEXT: [[TMP1:%.*]] = load double, ptr [[PTR:%.*]], align 8
175+
; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]]
176+
; CHECK: atomicrmw.start:
177+
; CHECK-NEXT: [[LOADED:%.*]] = phi double [ [[TMP1]], [[TMP0:%.*]] ], [ [[TMP6:%.*]], [[ATOMICRMW_START]] ]
178+
; CHECK-NEXT: [[TMP2:%.*]] = call double @llvm.minimum.f64(double [[LOADED]], double [[VALUE:%.*]])
179+
; CHECK-NEXT: [[TMP3:%.*]] = bitcast double [[TMP2]] to i64
180+
; CHECK-NEXT: [[TMP4:%.*]] = bitcast double [[LOADED]] to i64
181+
; CHECK-NEXT: [[TMP5:%.*]] = cmpxchg ptr [[PTR]], i64 [[TMP4]], i64 [[TMP3]] seq_cst seq_cst, align 8
182+
; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP5]], 1
183+
; CHECK-NEXT: [[NEWLOADED:%.*]] = extractvalue { i64, i1 } [[TMP5]], 0
184+
; CHECK-NEXT: [[TMP6]] = bitcast i64 [[NEWLOADED]] to double
185+
; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]]
186+
; CHECK: atomicrmw.end:
187+
; CHECK-NEXT: ret double [[TMP6]]
188+
;
189+
%res = atomicrmw fminimum ptr %ptr, double %value seq_cst
190+
ret double %res
191+
}
192+
193+
define double @atomicrmw_fmaximum_double(ptr %ptr, double %value) {
194+
; CHECK-LABEL: @atomicrmw_fmaximum_double(
195+
; CHECK-NEXT: [[TMP1:%.*]] = load double, ptr [[PTR:%.*]], align 8
196+
; CHECK-NEXT: br label [[ATOMICRMW_START:%.*]]
197+
; CHECK: atomicrmw.start:
198+
; CHECK-NEXT: [[LOADED:%.*]] = phi double [ [[TMP1]], [[TMP0:%.*]] ], [ [[TMP6:%.*]], [[ATOMICRMW_START]] ]
199+
; CHECK-NEXT: [[TMP2:%.*]] = call double @llvm.maximum.f64(double [[LOADED]], double [[VALUE:%.*]])
200+
; CHECK-NEXT: [[TMP3:%.*]] = bitcast double [[TMP2]] to i64
201+
; CHECK-NEXT: [[TMP4:%.*]] = bitcast double [[LOADED]] to i64
202+
; CHECK-NEXT: [[TMP5:%.*]] = cmpxchg ptr [[PTR]], i64 [[TMP4]], i64 [[TMP3]] seq_cst seq_cst, align 8
203+
; CHECK-NEXT: [[SUCCESS:%.*]] = extractvalue { i64, i1 } [[TMP5]], 1
204+
; CHECK-NEXT: [[NEWLOADED:%.*]] = extractvalue { i64, i1 } [[TMP5]], 0
205+
; CHECK-NEXT: [[TMP6]] = bitcast i64 [[NEWLOADED]] to double
206+
; CHECK-NEXT: br i1 [[SUCCESS]], label [[ATOMICRMW_END:%.*]], label [[ATOMICRMW_START]]
207+
; CHECK: atomicrmw.end:
208+
; CHECK-NEXT: ret double [[TMP6]]
209+
;
210+
%res = atomicrmw fmaximum ptr %ptr, double %value seq_cst
211+
ret double %res
212+
}

llvm/test/Transforms/InstCombine/atomicrmw.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ define double @no_sat_fmin_inf(ptr %addr) {
399399

400400
define double @sat_fmaximum_inf(ptr %addr) {
401401
; CHECK-LABEL: @sat_fmaximum_inf(
402-
; CHECK-NEXT: [[RES:%.*]] = atomicrmw xchg ptr [[ADDR:%.*]], double 0x7FF0000000000000 monotonic, align 8
402+
; CHECK-NEXT: [[RES:%.*]] = atomicrmw fmaximum ptr [[ADDR:%.*]], double 0x7FF0000000000000 monotonic, align 8
403403
; CHECK-NEXT: ret double [[RES]]
404404
;
405405
%res = atomicrmw fmaximum ptr %addr, double 0x7FF0000000000000 monotonic
@@ -417,7 +417,7 @@ define double @no_sat_fmaximum_inf(ptr %addr) {
417417

418418
define double @sat_fminimum_inf(ptr %addr) {
419419
; CHECK-LABEL: @sat_fminimum_inf(
420-
; CHECK-NEXT: [[RES:%.*]] = atomicrmw xchg ptr [[ADDR:%.*]], double 0xFFF0000000000000 monotonic, align 8
420+
; CHECK-NEXT: [[RES:%.*]] = atomicrmw fminimum ptr [[ADDR:%.*]], double 0xFFF0000000000000 monotonic, align 8
421421
; CHECK-NEXT: ret double [[RES]]
422422
;
423423
%res = atomicrmw fminimum ptr %addr, double 0xFFF0000000000000 monotonic
@@ -826,7 +826,7 @@ define double @no_sat_fmin_inf_preserve_md(ptr %addr) {
826826

827827
define double @sat_fmaximum_inf_preserve_md(ptr %addr) {
828828
; CHECK-LABEL: @sat_fmaximum_inf_preserve_md(
829-
; CHECK-NEXT: [[RES:%.*]] = atomicrmw xchg ptr [[ADDR:%.*]], double 0x7FF0000000000000 syncscope("agent") monotonic, align 8, !mmra [[META0]], !amdgpu.no.fine.grained.host.memory [[META1]], !amdgpu.no.remote.memory.access [[META1]]
829+
; CHECK-NEXT: [[RES:%.*]] = atomicrmw fmaximum ptr [[ADDR:%.*]], double 0x7FF0000000000000 syncscope("agent") monotonic, align 8, !mmra [[META0]], !amdgpu.no.fine.grained.host.memory [[META1]], !amdgpu.no.remote.memory.access [[META1]]
830830
; CHECK-NEXT: ret double [[RES]]
831831
;
832832
%res = atomicrmw fmaximum ptr %addr, double 0x7FF0000000000000 syncscope("agent") monotonic, !amdgpu.no.fine.grained.host.memory !0, !amdgpu.no.remote.memory.access !0, !mmra !1
@@ -844,7 +844,7 @@ define double @no_sat_fmaximum_inf_preserve_md(ptr %addr) {
844844

845845
define double @sat_fminimum_inf_preserve_md(ptr %addr) {
846846
; CHECK-LABEL: @sat_fminimum_inf_preserve_md(
847-
; CHECK-NEXT: [[RES:%.*]] = atomicrmw xchg ptr [[ADDR:%.*]], double 0xFFF0000000000000 syncscope("agent") monotonic, align 8, !mmra [[META0]], !amdgpu.no.fine.grained.host.memory [[META1]], !amdgpu.no.remote.memory.access [[META1]]
847+
; CHECK-NEXT: [[RES:%.*]] = atomicrmw fminimum ptr [[ADDR:%.*]], double 0xFFF0000000000000 syncscope("agent") monotonic, align 8, !mmra [[META0]], !amdgpu.no.fine.grained.host.memory [[META1]], !amdgpu.no.remote.memory.access [[META1]]
848848
; CHECK-NEXT: ret double [[RES]]
849849
;
850850
%res = atomicrmw fminimum ptr %addr, double 0xFFF0000000000000 syncscope("agent") monotonic, !amdgpu.no.fine.grained.host.memory !0, !amdgpu.no.remote.memory.access !0, !mmra !1

llvm/test/Transforms/LowerAtomic/atomic-load.ll

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,24 @@ define float @fminimum() {
100100
ret float %j
101101
; CHECK: ret float [[INST]]
102102
}
103+
104+
define <2 x half> @fmaximum_2xhalf(<2 x half> %val) {
105+
; CHECK-LABEL: @fmaximum_2xhalf(
106+
%i = alloca <2 x half>, align 4
107+
%j = atomicrmw fmaximum ptr %i, <2 x half> %val monotonic
108+
; CHECK: [[INST:%[a-z0-9]+]] = load
109+
; CHECK-NEXT: call <2 x half> @llvm.maximum.v2f16
110+
; CHECK-NEXT: store
111+
ret <2 x half> %j
112+
}
113+
114+
define <2 x half> @fminimum_2xhalf(<2 x half> %val) {
115+
; CHECK-LABEL: @fminimum_2xhalf(
116+
%i = alloca <2 x half>, align 4
117+
%j = atomicrmw fminimum ptr %i, <2 x half> %val monotonic
118+
; CHECK: [[INST:%[a-z0-9]+]] = load
119+
; CHECK-NEXT: call <2 x half> @llvm.minimum.v2f16
120+
; CHECK-NEXT: store
121+
ret <2 x half> %j
122+
}
123+

0 commit comments

Comments
 (0)