[llvm] [GlobalIsel] Combine logic of icmps (PR #77855)

Thorsten Schütt via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 02:22:51 PST 2024


================
@@ -635,19 +635,7 @@ define i64 @select_noccmp1(i64 %v1, i64 %v2, i64 %v3, i64 %r) {
 ;
 ; GISEL-LABEL: select_noccmp1:
 ; GISEL:       ; %bb.0:
-; GISEL-NEXT:    cmp x0, #0
-; GISEL-NEXT:    cset w8, lt
-; GISEL-NEXT:    cmp x0, #13
-; GISEL-NEXT:    cset w9, gt
-; GISEL-NEXT:    cmp x2, #2
-; GISEL-NEXT:    cset w10, lt
-; GISEL-NEXT:    cmp x2, #4
-; GISEL-NEXT:    cset w11, gt
-; GISEL-NEXT:    and w8, w8, w9
-; GISEL-NEXT:    and w9, w10, w11
-; GISEL-NEXT:    orr w8, w8, w9
-; GISEL-NEXT:    tst w8, #0x1
-; GISEL-NEXT:    csel x0, xzr, x3, ne
+; GISEL-NEXT:    mov x0, x3
----------------
tschuett wrote:

You can that as:
X < 0 && X > 13
X < 2 && X > 4


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


More information about the llvm-commits mailing list