1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=x86_64-linux-gnu -run-pass=instruction-select -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
42 tracksRegLiveness: true
44 - { id: 0, class: gpr }
45 - { id: 1, class: gpr }
46 - { id: 2, class: gpr }
51 ; CHECK-LABEL: name: ptrtoint_s1_p0
52 ; CHECK: liveins: $rdi
53 ; CHECK: [[COPY:%[0-9]+]]:gr64_with_sub_8bit = COPY $rdi
54 ; CHECK: [[COPY1:%[0-9]+]]:gr8 = COPY [[COPY]].sub_8bit
55 ; CHECK: $al = COPY [[COPY1]]
56 ; CHECK: RET 0, implicit $al
57 %0:gpr(p0) = COPY $rdi
58 %1:gpr(s1) = G_PTRTOINT %0(p0)
59 %2:gpr(s8) = G_ANYEXT %1(s1)
69 tracksRegLiveness: true
71 - { id: 0, class: gpr }
72 - { id: 1, class: gpr }
77 ; CHECK-LABEL: name: ptrtoint_s8_p0
78 ; CHECK: liveins: $rdi
79 ; CHECK: [[COPY:%[0-9]+]]:gr64_with_sub_8bit = COPY $rdi
80 ; CHECK: [[COPY1:%[0-9]+]]:gr8 = COPY [[COPY]].sub_8bit
81 ; CHECK: $al = COPY [[COPY1]]
82 ; CHECK: RET 0, implicit $al
83 %0:gpr(p0) = COPY $rdi
84 %1:gpr(s8) = G_PTRTOINT %0(p0)
94 tracksRegLiveness: true
96 - { id: 0, class: gpr }
97 - { id: 1, class: gpr }
102 ; CHECK-LABEL: name: ptrtoint_s16_p0
103 ; CHECK: liveins: $rdi
104 ; CHECK: [[COPY:%[0-9]+]]:gr64 = COPY $rdi
105 ; CHECK: [[COPY1:%[0-9]+]]:gr16 = COPY [[COPY]].sub_16bit
106 ; CHECK: $ax = COPY [[COPY1]]
107 ; CHECK: RET 0, implicit $ax
108 %0:gpr(p0) = COPY $rdi
109 %1:gpr(s16) = G_PTRTOINT %0(p0)
115 name: ptrtoint_s32_p0
118 regBankSelected: true
119 tracksRegLiveness: true
121 - { id: 0, class: gpr }
122 - { id: 1, class: gpr }
127 ; CHECK-LABEL: name: ptrtoint_s32_p0
128 ; CHECK: liveins: $rdi
129 ; CHECK: [[COPY:%[0-9]+]]:gr64 = COPY $rdi
130 ; CHECK: [[COPY1:%[0-9]+]]:gr32 = COPY [[COPY]].sub_32bit
131 ; CHECK: $eax = COPY [[COPY1]]
132 ; CHECK: RET 0, implicit $eax
133 %0:gpr(p0) = COPY $rdi
134 %1:gpr(s32) = G_PTRTOINT %0(p0)
140 name: ptrtoint_s64_p0
143 regBankSelected: true
144 tracksRegLiveness: true
146 - { id: 0, class: gpr }
147 - { id: 1, class: gpr }
152 ; CHECK-LABEL: name: ptrtoint_s64_p0
153 ; CHECK: liveins: $rdi
154 ; CHECK: [[COPY:%[0-9]+]]:gr64 = COPY $rdi
155 ; CHECK: $rax = COPY [[COPY]]
156 ; CHECK: RET 0, implicit $rax
157 %0:gpr(p0) = COPY $rdi
158 %1:gpr(s64) = G_PTRTOINT %0(p0)