163 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -mtriple=x86_64-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s3 4--- |5 6 define i1 @ptrtoint_s1_p0(ptr %p) {7 entry:8 %0 = ptrtoint ptr %p to i19 ret i1 %010 }11 12 define i8 @ptrtoint_s8_p0(ptr %p) {13 entry:14 %0 = ptrtoint ptr %p to i815 ret i8 %016 }17 18 define i16 @ptrtoint_s16_p0(ptr %p) {19 entry:20 %0 = ptrtoint ptr %p to i1621 ret i16 %022 }23 24 define i32 @ptrtoint_s32_p0(ptr %p) {25 entry:26 %0 = ptrtoint ptr %p to i3227 ret i32 %028 }29 30 define i64 @ptrtoint_s64_p0(ptr %p) {31 entry:32 %0 = ptrtoint ptr %p to i6433 ret i64 %034 }35 36...37---38name: ptrtoint_s1_p039alignment: 1640legalized: true41regBankSelected: true42tracksRegLiveness: true43registers:44 - { id: 0, class: gpr }45 - { id: 1, class: gpr }46 - { id: 2, class: gpr }47body: |48 bb.1.entry:49 liveins: $rdi50 51 ; CHECK-LABEL: name: ptrtoint_s1_p052 ; CHECK: liveins: $rdi53 ; CHECK: [[COPY:%[0-9]+]]:gr64_with_sub_8bit = COPY $rdi54 ; CHECK: [[COPY1:%[0-9]+]]:gr8 = COPY [[COPY]].sub_8bit55 ; CHECK: $al = COPY [[COPY1]]56 ; CHECK: RET 0, implicit $al57 %0:gpr(p0) = COPY $rdi58 %1:gpr(s1) = G_PTRTOINT %0(p0)59 %2:gpr(s8) = G_ANYEXT %1(s1)60 $al = COPY %2(s8)61 RET 0, implicit $al62 63...64---65name: ptrtoint_s8_p066alignment: 1667legalized: true68regBankSelected: true69tracksRegLiveness: true70registers:71 - { id: 0, class: gpr }72 - { id: 1, class: gpr }73body: |74 bb.1.entry:75 liveins: $rdi76 77 ; CHECK-LABEL: name: ptrtoint_s8_p078 ; CHECK: liveins: $rdi79 ; CHECK: [[COPY:%[0-9]+]]:gr64_with_sub_8bit = COPY $rdi80 ; CHECK: [[COPY1:%[0-9]+]]:gr8 = COPY [[COPY]].sub_8bit81 ; CHECK: $al = COPY [[COPY1]]82 ; CHECK: RET 0, implicit $al83 %0:gpr(p0) = COPY $rdi84 %1:gpr(s8) = G_PTRTOINT %0(p0)85 $al = COPY %1(s8)86 RET 0, implicit $al87 88...89---90name: ptrtoint_s16_p091alignment: 1692legalized: true93regBankSelected: true94tracksRegLiveness: true95registers:96 - { id: 0, class: gpr }97 - { id: 1, class: gpr }98body: |99 bb.1.entry:100 liveins: $rdi101 102 ; CHECK-LABEL: name: ptrtoint_s16_p0103 ; CHECK: liveins: $rdi104 ; CHECK: [[COPY:%[0-9]+]]:gr64 = COPY $rdi105 ; CHECK: [[COPY1:%[0-9]+]]:gr16 = COPY [[COPY]].sub_16bit106 ; CHECK: $ax = COPY [[COPY1]]107 ; CHECK: RET 0, implicit $ax108 %0:gpr(p0) = COPY $rdi109 %1:gpr(s16) = G_PTRTOINT %0(p0)110 $ax = COPY %1(s16)111 RET 0, implicit $ax112 113...114---115name: ptrtoint_s32_p0116alignment: 16117legalized: true118regBankSelected: true119tracksRegLiveness: true120registers:121 - { id: 0, class: gpr }122 - { id: 1, class: gpr }123body: |124 bb.1.entry:125 liveins: $rdi126 127 ; CHECK-LABEL: name: ptrtoint_s32_p0128 ; CHECK: liveins: $rdi129 ; CHECK: [[COPY:%[0-9]+]]:gr64 = COPY $rdi130 ; CHECK: [[COPY1:%[0-9]+]]:gr32 = COPY [[COPY]].sub_32bit131 ; CHECK: $eax = COPY [[COPY1]]132 ; CHECK: RET 0, implicit $eax133 %0:gpr(p0) = COPY $rdi134 %1:gpr(s32) = G_PTRTOINT %0(p0)135 $eax = COPY %1(s32)136 RET 0, implicit $eax137 138...139---140name: ptrtoint_s64_p0141alignment: 16142legalized: true143regBankSelected: true144tracksRegLiveness: true145registers:146 - { id: 0, class: gpr }147 - { id: 1, class: gpr }148body: |149 bb.1.entry:150 liveins: $rdi151 152 ; CHECK-LABEL: name: ptrtoint_s64_p0153 ; CHECK: liveins: $rdi154 ; CHECK: [[COPY:%[0-9]+]]:gr64 = COPY $rdi155 ; CHECK: $rax = COPY [[COPY]]156 ; CHECK: RET 0, implicit $rax157 %0:gpr(p0) = COPY $rdi158 %1:gpr(s64) = G_PTRTOINT %0(p0)159 $rax = COPY %1(s64)160 RET 0, implicit $rax161 162...163