• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3
4--- |
5
6  define i1 @ptrtoint_s1_p0(i64* %p) {
7  entry:
8    %0 = ptrtoint i64* %p to i1
9    ret i1 %0
10  }
11
12  define i8 @ptrtoint_s8_p0(i64* %p) {
13  entry:
14    %0 = ptrtoint i64* %p to i8
15    ret i8 %0
16  }
17
18  define i16 @ptrtoint_s16_p0(i64* %p) {
19  entry:
20    %0 = ptrtoint i64* %p to i16
21    ret i16 %0
22  }
23
24  define i32 @ptrtoint_s32_p0(i64* %p) {
25  entry:
26    %0 = ptrtoint i64* %p to i32
27    ret i32 %0
28  }
29
30...
31---
32name:            ptrtoint_s1_p0
33alignment:       16
34tracksRegLiveness: true
35registers:
36  - { id: 0, class: _ }
37  - { id: 1, class: _ }
38  - { id: 2, class: _ }
39  - { id: 3, class: _ }
40frameInfo:
41  maxAlignment:    4
42fixedStack:
43  - { id: 0, size: 4, alignment: 16, stack-id: default, isImmutable: true }
44body:             |
45  bb.1.entry:
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)
57    $al = COPY %3(s8)
58    RET 0, implicit $al
59
60...
61---
62name:            ptrtoint_s8_p0
63alignment:       16
64tracksRegLiveness: true
65registers:
66  - { id: 0, class: _ }
67  - { id: 1, class: _ }
68  - { id: 2, class: _ }
69frameInfo:
70  maxAlignment:    4
71fixedStack:
72  - { id: 0, size: 4, alignment: 16, stack-id: default, isImmutable: true }
73body:             |
74  bb.1.entry:
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)
84    $al = COPY %2(s8)
85    RET 0, implicit $al
86
87...
88---
89name:            ptrtoint_s16_p0
90alignment:       16
91tracksRegLiveness: true
92registers:
93  - { id: 0, class: _ }
94  - { id: 1, class: _ }
95  - { id: 2, class: _ }
96frameInfo:
97  maxAlignment:    4
98fixedStack:
99  - { id: 0, size: 4, alignment: 16, stack-id: default, isImmutable: true }
100body:             |
101  bb.1.entry:
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)
111    $ax = COPY %2(s16)
112    RET 0, implicit $ax
113
114...
115---
116name:            ptrtoint_s32_p0
117alignment:       16
118tracksRegLiveness: true
119registers:
120  - { id: 0, class: _ }
121  - { id: 1, class: _ }
122  - { id: 2, class: _ }
123frameInfo:
124  maxAlignment:    4
125fixedStack:
126  - { id: 0, size: 4, alignment: 16, stack-id: default, isImmutable: true }
127body:             |
128  bb.1.entry:
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)
138    $eax = COPY %2(s32)
139    RET 0, implicit $eax
140
141...
142