1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=x86_64-linux-gnu -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s
6 define i1 @ptrtoint_s1_p0(i64* %p) {
8 %0 = ptrtoint i64* %p to i1
12 define i8 @ptrtoint_s8_p0(i64* %p) {
14 %0 = ptrtoint i64* %p to i8
18 define i16 @ptrtoint_s16_p0(i64* %p) {
20 %0 = ptrtoint i64* %p to i16
24 define i32 @ptrtoint_s32_p0(i64* %p) {
26 %0 = ptrtoint i64* %p to i32
30 define i64 @ptrtoint_s64_p0(i64* %p) {
32 %0 = ptrtoint i64* %p to i64
40 tracksRegLiveness: true
49 ; CHECK-LABEL: name: ptrtoint_s1_p0
50 ; CHECK: liveins: $rdi
51 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $rdi
52 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s1) = G_PTRTOINT [[COPY]](p0)
53 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s8) = G_ANYEXT [[PTRTOINT]](s1)
54 ; CHECK: $al = COPY [[ANYEXT]](s8)
55 ; CHECK: RET 0, implicit $al
57 %1:_(s1) = G_PTRTOINT %0(p0)
58 %2:_(s8) = G_ANYEXT %1(s1)
66 tracksRegLiveness: true
74 ; CHECK-LABEL: name: ptrtoint_s8_p0
75 ; CHECK: liveins: $rdi
76 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $rdi
77 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s8) = G_PTRTOINT [[COPY]](p0)
78 ; CHECK: $al = COPY [[PTRTOINT]](s8)
79 ; CHECK: RET 0, implicit $al
81 %1:_(s8) = G_PTRTOINT %0(p0)
89 tracksRegLiveness: true
97 ; CHECK-LABEL: name: ptrtoint_s16_p0
98 ; CHECK: liveins: $rdi
99 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $rdi
100 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s16) = G_PTRTOINT [[COPY]](p0)
101 ; CHECK: $ax = COPY [[PTRTOINT]](s16)
102 ; CHECK: RET 0, implicit $ax
104 %1:_(s16) = G_PTRTOINT %0(p0)
110 name: ptrtoint_s32_p0
112 tracksRegLiveness: true
114 - { id: 0, class: _ }
115 - { id: 1, class: _ }
120 ; CHECK-LABEL: name: ptrtoint_s32_p0
121 ; CHECK: liveins: $rdi
122 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $rdi
123 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p0)
124 ; CHECK: $eax = COPY [[PTRTOINT]](s32)
125 ; CHECK: RET 0, implicit $eax
127 %1:_(s32) = G_PTRTOINT %0(p0)
133 name: ptrtoint_s64_p0
135 tracksRegLiveness: true
137 - { id: 0, class: _ }
138 - { id: 1, class: _ }
143 ; CHECK-LABEL: name: ptrtoint_s64_p0
144 ; CHECK: liveins: $rdi
145 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $rdi
146 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT [[COPY]](p0)
147 ; CHECK: $rax = COPY [[PTRTOINT]](s64)
148 ; CHECK: RET 0, implicit $rax
150 %1:_(s64) = G_PTRTOINT %0(p0)