# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py # RUN: llc -O0 -mtriple=aarch64 -run-pass=legalizer -global-isel-abort=1 -verify-machineinstrs %s -o - | FileCheck %s --- name: test_icmp body: | bb.0.entry: ; CHECK-LABEL: name: test_icmp ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x0 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(sge), [[COPY]](s64), [[COPY1]] ; CHECK-NEXT: $w0 = COPY [[ICMP]](s32) ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64) ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]] ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64) ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC1]], [[C]] ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[AND]](s32), [[AND1]] ; CHECK-NEXT: $w0 = COPY [[ICMP1]](s32) ; CHECK-NEXT: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[COPY]](s64) ; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[INTTOPTR]](p0), [[INTTOPTR]] ; CHECK-NEXT: $w0 = COPY [[ICMP2]](s32) %0:_(s64) = COPY $x0 %1:_(s64) = COPY $x0 %2:_(s8) = G_TRUNC %0(s64) %3:_(s8) = G_TRUNC %1(s64) %4:_(s1) = G_ICMP intpred(sge), %0(s64), %1 %11:_(s32) = G_ANYEXT %4(s1) $w0 = COPY %11(s32) %8:_(s1) = G_ICMP intpred(ult), %2(s8), %3 %12:_(s32) = G_ANYEXT %8(s1) $w0 = COPY %12(s32) %9:_(p0) = G_INTTOPTR %0(s64) %10:_(s1) = G_ICMP intpred(eq), %9(p0), %9 %14:_(s32) = G_ANYEXT %10(s1) $w0 = COPY %14(s32) ... --- name: test_s128 alignment: 4 tracksRegLiveness: true body: | ; CHECK-LABEL: name: test_s128 ; CHECK: bb.0: ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 4294967296 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[DEF]](s64), [[C1]] ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[DEF]](s64), [[C1]] ; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[DEF]](s64), [[C]] ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP1]], [[C2]] ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[ICMP2]], [[ICMP]] ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[SELECT]], [[C2]] ; CHECK-NEXT: G_BRCOND [[AND1]](s32), %bb.1 ; CHECK-NEXT: G_BR %bb.2 ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: bb.1: ; CHECK-NEXT: successors: ; CHECK: bb.2: ; CHECK-NEXT: RET_ReallyLR bb.1: %0:_(s128) = G_IMPLICIT_DEF %1:_(s128) = G_CONSTANT i128 79228162514264337593543950336 %3:_(s1) = G_CONSTANT i1 true %2:_(s1) = G_ICMP intpred(ult), %0(s128), %1 G_BRCOND %2(s1), %bb.2 G_BR %bb.3 bb.2: successors: bb.3: RET_ReallyLR ... --- name: test_s128_eq tracksRegLiveness: true body: | ; CHECK-LABEL: name: test_s128_eq ; CHECK: bb.0: ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[DEF]], [[DEF]] ; CHECK-NEXT: [[XOR1:%[0-9]+]]:_(s64) = G_XOR [[DEF]], [[DEF]] ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[XOR]], [[XOR1]] ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[OR]](s64), [[C]] ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]] ; CHECK-NEXT: G_BRCOND [[AND]](s32), %bb.1 ; CHECK-NEXT: G_BR %bb.2 ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: bb.1: ; CHECK-NEXT: successors: ; CHECK: bb.2: ; CHECK-NEXT: RET_ReallyLR bb.1: %lhs:_(s128) = G_IMPLICIT_DEF %rhs:_(s128) = G_IMPLICIT_DEF %cmp:_(s1) = G_ICMP intpred(eq), %lhs(s128), %rhs G_BRCOND %cmp(s1), %bb.2 G_BR %bb.3 bb.2: successors: bb.3: RET_ReallyLR ... --- name: test_s88_eq tracksRegLiveness: true body: | ; CHECK-LABEL: name: test_s88_eq ; CHECK: bb.0: ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 16777215 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]] ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C1]] ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]] ; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C1]] ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 0 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[AND]], [[AND2]] ; CHECK-NEXT: [[XOR1:%[0-9]+]]:_(s64) = G_XOR [[AND1]], [[AND3]] ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[XOR]], [[XOR1]] ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[OR]](s64), [[C2]] ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 ; CHECK-NEXT: [[AND4:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C3]] ; CHECK-NEXT: G_BRCOND [[AND4]](s32), %bb.1 ; CHECK-NEXT: G_BR %bb.2 ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: bb.1: ; CHECK-NEXT: successors: ; CHECK: bb.2: ; CHECK-NEXT: RET_ReallyLR bb.1: %lhs:_(s88) = G_IMPLICIT_DEF %rhs:_(s88) = G_IMPLICIT_DEF %cmp:_(s1) = G_ICMP intpred(eq), %lhs(s88), %rhs G_BRCOND %cmp(s1), %bb.2 G_BR %bb.3 bb.2: successors: bb.3: RET_ReallyLR ... --- name: test_s88_ne tracksRegLiveness: true body: | ; CHECK-LABEL: name: test_s88_ne ; CHECK: bb.0: ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 16777215 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]] ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C1]] ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]] ; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C1]] ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 0 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[AND]], [[AND2]] ; CHECK-NEXT: [[XOR1:%[0-9]+]]:_(s64) = G_XOR [[AND1]], [[AND3]] ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[XOR]], [[XOR1]] ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[OR]](s64), [[C2]] ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 ; CHECK-NEXT: [[AND4:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C3]] ; CHECK-NEXT: G_BRCOND [[AND4]](s32), %bb.1 ; CHECK-NEXT: G_BR %bb.2 ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: bb.1: ; CHECK-NEXT: successors: ; CHECK: bb.2: ; CHECK-NEXT: RET_ReallyLR bb.1: %lhs:_(s88) = G_IMPLICIT_DEF %rhs:_(s88) = G_IMPLICIT_DEF %cmp:_(s1) = G_ICMP intpred(ne), %lhs(s88), %rhs G_BRCOND %cmp(s1), %bb.2 G_BR %bb.3 bb.2: successors: bb.3: RET_ReallyLR ... --- name: test_s96_eq tracksRegLiveness: true body: | ; CHECK-LABEL: name: test_s96_eq ; CHECK: bb.0: ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 4294967295 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]] ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C1]] ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]] ; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C1]] ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 0 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[AND]], [[AND2]] ; CHECK-NEXT: [[XOR1:%[0-9]+]]:_(s64) = G_XOR [[AND1]], [[AND3]] ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[XOR]], [[XOR1]] ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[OR]](s64), [[C2]] ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 ; CHECK-NEXT: [[AND4:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C3]] ; CHECK-NEXT: G_BRCOND [[AND4]](s32), %bb.1 ; CHECK-NEXT: G_BR %bb.2 ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: bb.1: ; CHECK-NEXT: successors: ; CHECK: bb.2: ; CHECK-NEXT: RET_ReallyLR bb.1: %lhs:_(s96) = G_IMPLICIT_DEF %rhs:_(s96) = G_IMPLICIT_DEF %cmp:_(s1) = G_ICMP intpred(eq), %lhs(s96), %rhs G_BRCOND %cmp(s1), %bb.2 G_BR %bb.3 bb.2: successors: bb.3: RET_ReallyLR ... --- name: test_s318_eq tracksRegLiveness: true body: | ; CHECK-LABEL: name: test_s318_eq ; CHECK: bb.0: ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 4611686018427387903 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 0 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]] ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]] ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]] ; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]] ; CHECK-NEXT: [[AND4:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C1]] ; CHECK-NEXT: [[AND5:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C2]] ; CHECK-NEXT: [[AND6:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C2]] ; CHECK-NEXT: [[AND7:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C2]] ; CHECK-NEXT: [[AND8:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]] ; CHECK-NEXT: [[AND9:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]] ; CHECK-NEXT: [[AND10:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]] ; CHECK-NEXT: [[AND11:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]] ; CHECK-NEXT: [[AND12:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C1]] ; CHECK-NEXT: [[AND13:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C2]] ; CHECK-NEXT: [[AND14:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C2]] ; CHECK-NEXT: [[AND15:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C2]] ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[AND]], [[AND8]] ; CHECK-NEXT: [[XOR1:%[0-9]+]]:_(s64) = G_XOR [[AND1]], [[AND9]] ; CHECK-NEXT: [[XOR2:%[0-9]+]]:_(s64) = G_XOR [[AND2]], [[AND10]] ; CHECK-NEXT: [[XOR3:%[0-9]+]]:_(s64) = G_XOR [[AND3]], [[AND11]] ; CHECK-NEXT: [[XOR4:%[0-9]+]]:_(s64) = G_XOR [[AND4]], [[AND12]] ; CHECK-NEXT: [[XOR5:%[0-9]+]]:_(s64) = G_XOR [[AND5]], [[AND13]] ; CHECK-NEXT: [[XOR6:%[0-9]+]]:_(s64) = G_XOR [[AND6]], [[AND14]] ; CHECK-NEXT: [[XOR7:%[0-9]+]]:_(s64) = G_XOR [[AND7]], [[AND15]] ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[XOR]], [[XOR1]] ; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s64) = G_OR [[OR]], [[XOR2]] ; CHECK-NEXT: [[OR2:%[0-9]+]]:_(s64) = G_OR [[OR1]], [[XOR3]] ; CHECK-NEXT: [[OR3:%[0-9]+]]:_(s64) = G_OR [[OR2]], [[XOR4]] ; CHECK-NEXT: [[OR4:%[0-9]+]]:_(s64) = G_OR [[OR3]], [[XOR5]] ; CHECK-NEXT: [[OR5:%[0-9]+]]:_(s64) = G_OR [[OR4]], [[XOR6]] ; CHECK-NEXT: [[OR6:%[0-9]+]]:_(s64) = G_OR [[OR5]], [[XOR7]] ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[OR6]](s64), [[C2]] ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 ; CHECK-NEXT: [[AND16:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C3]] ; CHECK-NEXT: G_BRCOND [[AND16]](s32), %bb.1 ; CHECK-NEXT: G_BR %bb.2 ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: bb.1: ; CHECK-NEXT: successors: ; CHECK: bb.2: ; CHECK-NEXT: RET_ReallyLR bb.1: %lhs:_(s318) = G_IMPLICIT_DEF %rhs:_(s318) = G_IMPLICIT_DEF %cmp:_(s1) = G_ICMP intpred(eq), %lhs(s318), %rhs G_BRCOND %cmp(s1), %bb.2 G_BR %bb.3 bb.2: successors: bb.3: RET_ReallyLR ... --- name: test_s158_eq tracksRegLiveness: true body: | ; CHECK-LABEL: name: test_s158_eq ; CHECK: bb.0: ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1073741823 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 0 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]] ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]] ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C1]] ; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C2]] ; CHECK-NEXT: [[AND4:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]] ; CHECK-NEXT: [[AND5:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]] ; CHECK-NEXT: [[AND6:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C1]] ; CHECK-NEXT: [[AND7:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C2]] ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[AND]], [[AND4]] ; CHECK-NEXT: [[XOR1:%[0-9]+]]:_(s64) = G_XOR [[AND1]], [[AND5]] ; CHECK-NEXT: [[XOR2:%[0-9]+]]:_(s64) = G_XOR [[AND2]], [[AND6]] ; CHECK-NEXT: [[XOR3:%[0-9]+]]:_(s64) = G_XOR [[AND3]], [[AND7]] ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[XOR]], [[XOR1]] ; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s64) = G_OR [[OR]], [[XOR2]] ; CHECK-NEXT: [[OR2:%[0-9]+]]:_(s64) = G_OR [[OR1]], [[XOR3]] ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[OR2]](s64), [[C2]] ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 ; CHECK-NEXT: [[AND8:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C3]] ; CHECK-NEXT: G_BRCOND [[AND8]](s32), %bb.1 ; CHECK-NEXT: G_BR %bb.2 ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: bb.1: ; CHECK-NEXT: successors: ; CHECK: bb.2: ; CHECK-NEXT: RET_ReallyLR bb.1: %lhs:_(s158) = G_IMPLICIT_DEF %rhs:_(s158) = G_IMPLICIT_DEF %cmp:_(s1) = G_ICMP intpred(eq), %lhs(s158), %rhs G_BRCOND %cmp(s1), %bb.2 G_BR %bb.3 bb.2: successors: bb.3: RET_ReallyLR