1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=i686-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
34 tracksRegLiveness: true
43 - { id: 0, size: 4, alignment: 16, stack-id: default, isImmutable: true }
46 ; CHECK-LABEL: name: ptrtoint_s1_p0
47 ; CHECK: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.0
48 ; CHECK: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[FRAME_INDEX]](p0) :: (invariant load 4 from %fixed-stack.0, align 16)
49 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s1) = G_PTRTOINT [[LOAD]](p0)
50 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s8) = G_ANYEXT [[PTRTOINT]](s1)
51 ; CHECK: $al = COPY [[ANYEXT]](s8)
52 ; CHECK: RET 0, implicit $al
53 %1:_(p0) = G_FRAME_INDEX %fixed-stack.0
54 %0:_(p0) = G_LOAD %1(p0) :: (invariant load 4 from %fixed-stack.0, align 16)
55 %2:_(s1) = G_PTRTOINT %0(p0)
56 %3:_(s8) = G_ANYEXT %2(s1)
64 tracksRegLiveness: true
72 - { id: 0, size: 4, alignment: 16, stack-id: default, isImmutable: true }
75 ; CHECK-LABEL: name: ptrtoint_s8_p0
76 ; CHECK: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.0
77 ; CHECK: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[FRAME_INDEX]](p0) :: (invariant load 4 from %fixed-stack.0, align 16)
78 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s8) = G_PTRTOINT [[LOAD]](p0)
79 ; CHECK: $al = COPY [[PTRTOINT]](s8)
80 ; CHECK: RET 0, implicit $al
81 %1:_(p0) = G_FRAME_INDEX %fixed-stack.0
82 %0:_(p0) = G_LOAD %1(p0) :: (invariant load 4 from %fixed-stack.0, align 16)
83 %2:_(s8) = G_PTRTOINT %0(p0)
91 tracksRegLiveness: true
99 - { id: 0, size: 4, alignment: 16, stack-id: default, isImmutable: true }
102 ; CHECK-LABEL: name: ptrtoint_s16_p0
103 ; CHECK: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.0
104 ; CHECK: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[FRAME_INDEX]](p0) :: (invariant load 4 from %fixed-stack.0, align 16)
105 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s16) = G_PTRTOINT [[LOAD]](p0)
106 ; CHECK: $ax = COPY [[PTRTOINT]](s16)
107 ; CHECK: RET 0, implicit $ax
108 %1:_(p0) = G_FRAME_INDEX %fixed-stack.0
109 %0:_(p0) = G_LOAD %1(p0) :: (invariant load 4 from %fixed-stack.0, align 16)
110 %2:_(s16) = G_PTRTOINT %0(p0)
116 name: ptrtoint_s32_p0
118 tracksRegLiveness: true
120 - { id: 0, class: _ }
121 - { id: 1, class: _ }
122 - { id: 2, class: _ }
126 - { id: 0, size: 4, alignment: 16, stack-id: default, isImmutable: true }
129 ; CHECK-LABEL: name: ptrtoint_s32_p0
130 ; CHECK: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.0
131 ; CHECK: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[FRAME_INDEX]](p0) :: (invariant load 4 from %fixed-stack.0, align 16)
132 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[LOAD]](p0)
133 ; CHECK: $eax = COPY [[PTRTOINT]](s32)
134 ; CHECK: RET 0, implicit $eax
135 %1:_(p0) = G_FRAME_INDEX %fixed-stack.0
136 %0:_(p0) = G_LOAD %1(p0) :: (invariant load 4 from %fixed-stack.0, align 16)
137 %2:_(s32) = G_PTRTOINT %0(p0)