1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32
6 tracksRegLiveness: true
11 ; MIPS32-LABEL: name: ctlz_i32
12 ; MIPS32: liveins: $a0
14 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
15 ; MIPS32-NEXT: [[CTLZ:%[0-9]+]]:_(s32) = G_CTLZ [[COPY]](s32)
16 ; MIPS32-NEXT: $v0 = COPY [[CTLZ]](s32)
17 ; MIPS32-NEXT: RetRA implicit $v0
19 %1:_(s32) = G_CTLZ %0(s32)
27 tracksRegLiveness: true
32 ; MIPS32-LABEL: name: ctlz_i64
33 ; MIPS32: liveins: $a0, $a1
35 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
36 ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
37 ; MIPS32-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
38 ; MIPS32-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[C]]
39 ; MIPS32-NEXT: [[CTLZ:%[0-9]+]]:_(s32) = G_CTLZ [[COPY]](s32)
40 ; MIPS32-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 32
41 ; MIPS32-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[CTLZ]], [[C1]]
42 ; MIPS32-NEXT: [[CTLZ1:%[0-9]+]]:_(s32) = G_CTLZ [[COPY1]](s32)
43 ; MIPS32-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s32), [[ADD]], [[CTLZ1]]
44 ; MIPS32-NEXT: $v0 = COPY [[SELECT]](s32)
45 ; MIPS32-NEXT: $v1 = COPY [[C]](s32)
46 ; MIPS32-NEXT: RetRA implicit $v0, implicit $v1
49 %0:_(s64) = G_MERGE_VALUES %1(s32), %2(s32)
50 %3:_(s64) = G_CTLZ %0(s64)
51 %4:_(s32), %5:_(s32) = G_UNMERGE_VALUES %3(s64)
54 RetRA implicit $v0, implicit $v1