[llvm] [GlobalIsel] Combine select to integer minmax. (PR #77213)

Thorsten Schütt via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 7 07:22:13 PST 2024


================
@@ -2421,7 +2421,7 @@ define i8 @atomicrmw_min_i8(ptr %ptr, i8 %rhs) {
 ; CHECK-NOLSE-O1-NEXT:    ldaxrb w8, [x0]
 ; CHECK-NOLSE-O1-NEXT:    sxtb w9, w8
 ; CHECK-NOLSE-O1-NEXT:    cmp w9, w1, sxtb
-; CHECK-NOLSE-O1-NEXT:    csel w9, w8, w1, le
+; CHECK-NOLSE-O1-NEXT:    csel w9, w8, w1, lt
----------------
tschuett wrote:

lt: Signed less than
le: Signed less than or equal
It is equivalent to ICMP_SLT and ICMP_SLE and thus G_SMIN. The semantics did not change.

https://github.com/llvm/llvm-project/pull/77213


More information about the llvm-commits mailing list