[llvm] [AtomicExpandPass] Match isIdempotentRMW with InstcombineRMW (PR #142277)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 4 08:48:18 PDT 2025
================
@@ -85,6 +85,26 @@ define i8 @atomic_max_smin_char(ptr %addr) {
ret i8 %res
}
+; Idempotent atomicrmw are still canonicalized.
+define i8 @atomic_min_umax_char(ptr %addr) {
+; CHECK-LABEL: @atomic_min_umax_char(
+; CHECK-NEXT: [[RES:%.*]] = atomicrmw or ptr [[ADDR:%.*]], i8 0 monotonic, align 1
+; CHECK-NEXT: ret i8 [[RES]]
+;
+ %res = atomicrmw umin ptr %addr, i8 255 monotonic
+ ret i8 %res
+}
+
+; Idempotent atomicrmw are still canonicalized.
+define i8 @atomic_max_umin_char(ptr %addr) {
----------------
AZero13 wrote:
Nah.
https://github.com/llvm/llvm-project/pull/142277
More information about the llvm-commits
mailing list