1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64 -global-isel -verify-machineinstrs -run-pass=legalizer %s -o - | FileCheck %s
7 tracksRegLiveness: true
11 ; CHECK-LABEL: name: s8
13 ; CHECK: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
14 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 256
15 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[DEF]], [[C]]
16 ; CHECK: [[BITREVERSE:%[0-9]+]]:_(s32) = G_BITREVERSE [[OR]]
17 ; CHECK: [[CTLZ:%[0-9]+]]:_(s32) = G_CTLZ [[BITREVERSE]](s32)
18 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY [[CTLZ]](s32)
19 ; CHECK: %ext:_(s32) = COPY [[COPY]](s32)
20 ; CHECK: $w0 = COPY %ext(s32)
21 ; CHECK: RET_ReallyLR implicit $w0
22 %val:_(s8) = G_IMPLICIT_DEF
23 %cttz:_(s8) = G_CTTZ %val(s8)
24 %ext:_(s32) = G_ANYEXT %cttz(s8)
26 RET_ReallyLR implicit $w0
31 tracksRegLiveness: true
35 ; CHECK-LABEL: name: s16
37 ; CHECK: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
38 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65536
39 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[DEF]], [[C]]
40 ; CHECK: [[BITREVERSE:%[0-9]+]]:_(s32) = G_BITREVERSE [[OR]]
41 ; CHECK: [[CTLZ:%[0-9]+]]:_(s32) = G_CTLZ [[BITREVERSE]](s32)
42 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY [[CTLZ]](s32)
43 ; CHECK: %ext:_(s32) = COPY [[COPY]](s32)
44 ; CHECK: $w0 = COPY %ext(s32)
45 ; CHECK: RET_ReallyLR implicit $w0
46 %val:_(s16) = G_IMPLICIT_DEF
47 %cttz:_(s16) = G_CTTZ %val(s16)
48 %ext:_(s32) = G_ANYEXT %cttz(s16)
50 RET_ReallyLR implicit $w0
56 tracksRegLiveness: true
61 ; CHECK-LABEL: name: s32
63 ; CHECK: %val:_(s32) = COPY $w0
64 ; CHECK: [[BITREVERSE:%[0-9]+]]:_(s32) = G_BITREVERSE %val
65 ; CHECK: [[CTLZ:%[0-9]+]]:_(s32) = G_CTLZ [[BITREVERSE]](s32)
66 ; CHECK: $w0 = COPY [[CTLZ]](s32)
67 ; CHECK: RET_ReallyLR implicit $w0
68 %val:_(s32) = COPY $w0
69 %1:_(s32) = G_CTTZ %val(s32)
71 RET_ReallyLR implicit $w0
77 tracksRegLiveness: true
82 ; CHECK-LABEL: name: s64
84 ; CHECK: %val:_(s64) = COPY $x0
85 ; CHECK: [[BITREVERSE:%[0-9]+]]:_(s64) = G_BITREVERSE %val
86 ; CHECK: [[CTLZ:%[0-9]+]]:_(s64) = G_CTLZ [[BITREVERSE]](s64)
87 ; CHECK: $x0 = COPY [[CTLZ]](s64)
88 ; CHECK: RET_ReallyLR implicit $x0
89 %val:_(s64) = COPY $x0
90 %1:_(s64) = G_CTTZ %val(s64)
92 RET_ReallyLR implicit $x0