• 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  ; ModuleID = 'udiv.ll'
6  source_filename = "udiv.ll"
7  target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
8
9  define i8 @test_udiv_i8(i8 %arg1, i8 %arg2) {
10    %res = udiv i8 %arg1, %arg2
11    ret i8 %res
12  }
13
14  define i16 @test_udiv_i16(i16 %arg1, i16 %arg2) {
15    %res = udiv i16 %arg1, %arg2
16    ret i16 %res
17  }
18
19  define i32 @test_udiv_i32(i32 %arg1, i32 %arg2) {
20    %res = udiv i32 %arg1, %arg2
21    ret i32 %res
22  }
23
24...
25---
26name:            test_udiv_i8
27alignment:       16
28exposesReturnsTwice: false
29legalized:       false
30regBankSelected: false
31selected:        false
32failedISel:      false
33tracksRegLiveness: true
34registers:
35  - { id: 0, class: _, preferred-register: '' }
36  - { id: 1, class: _, preferred-register: '' }
37  - { id: 2, class: _, preferred-register: '' }
38  - { id: 3, class: _, preferred-register: '' }
39  - { id: 4, class: _, preferred-register: '' }
40liveins:
41frameInfo:
42  isFrameAddressTaken: false
43  isReturnAddressTaken: false
44  hasStackMap:     false
45  hasPatchPoint:   false
46  stackSize:       0
47  offsetAdjustment: 0
48  maxAlignment:    0
49  adjustsStack:    false
50  hasCalls:        false
51  stackProtector:  ''
52  maxCallFrameSize: 4294967295
53  hasOpaqueSPAdjustment: false
54  hasVAStart:      false
55  hasMustTailInVarArgFunc: false
56  localFrameSize:  0
57  savePoint:       ''
58  restorePoint:    ''
59fixedStack:
60stack:
61constants:
62body:             |
63  bb.1 (%ir-block.0):
64    liveins: $edi, $esi
65
66    ; CHECK-LABEL: name: test_udiv_i8
67    ; CHECK: liveins: $edi, $esi
68    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
69    ; CHECK: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32)
70    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
71    ; CHECK: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY1]](s32)
72    ; CHECK: [[UDIV:%[0-9]+]]:_(s8) = G_UDIV [[TRUNC]], [[TRUNC1]]
73    ; CHECK: $al = COPY [[UDIV]](s8)
74    ; CHECK: RET 0, implicit $al
75    %2:_(s32) = COPY $edi
76    %0:_(s8) = G_TRUNC %2(s32)
77    %3:_(s32) = COPY $esi
78    %1:_(s8) = G_TRUNC %3(s32)
79    %4:_(s8) = G_UDIV %0, %1
80    $al = COPY %4(s8)
81    RET 0, implicit $al
82
83...
84---
85name:            test_udiv_i16
86alignment:       16
87exposesReturnsTwice: false
88legalized:       false
89regBankSelected: false
90selected:        false
91failedISel:      false
92tracksRegLiveness: true
93registers:
94  - { id: 0, class: _, preferred-register: '' }
95  - { id: 1, class: _, preferred-register: '' }
96  - { id: 2, class: _, preferred-register: '' }
97  - { id: 3, class: _, preferred-register: '' }
98  - { id: 4, class: _, preferred-register: '' }
99liveins:
100frameInfo:
101  isFrameAddressTaken: false
102  isReturnAddressTaken: false
103  hasStackMap:     false
104  hasPatchPoint:   false
105  stackSize:       0
106  offsetAdjustment: 0
107  maxAlignment:    0
108  adjustsStack:    false
109  hasCalls:        false
110  stackProtector:  ''
111  maxCallFrameSize: 4294967295
112  hasOpaqueSPAdjustment: false
113  hasVAStart:      false
114  hasMustTailInVarArgFunc: false
115  localFrameSize:  0
116  savePoint:       ''
117  restorePoint:    ''
118fixedStack:
119stack:
120constants:
121body:             |
122  bb.1 (%ir-block.0):
123    liveins: $edi, $esi
124
125    ; CHECK-LABEL: name: test_udiv_i16
126    ; CHECK: liveins: $edi, $esi
127    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
128    ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
129    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
130    ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
131    ; CHECK: [[UDIV:%[0-9]+]]:_(s16) = G_UDIV [[TRUNC]], [[TRUNC1]]
132    ; CHECK: $ax = COPY [[UDIV]](s16)
133    ; CHECK: RET 0, implicit $ax
134    %2:_(s32) = COPY $edi
135    %0:_(s16) = G_TRUNC %2(s32)
136    %3:_(s32) = COPY $esi
137    %1:_(s16) = G_TRUNC %3(s32)
138    %4:_(s16) = G_UDIV %0, %1
139    $ax = COPY %4(s16)
140    RET 0, implicit $ax
141
142...
143---
144name:            test_udiv_i32
145alignment:       16
146exposesReturnsTwice: false
147legalized:       false
148regBankSelected: false
149selected:        false
150failedISel:      false
151tracksRegLiveness: true
152registers:
153  - { id: 0, class: _, preferred-register: '' }
154  - { id: 1, class: _, preferred-register: '' }
155  - { id: 2, class: _, preferred-register: '' }
156liveins:
157frameInfo:
158  isFrameAddressTaken: false
159  isReturnAddressTaken: false
160  hasStackMap:     false
161  hasPatchPoint:   false
162  stackSize:       0
163  offsetAdjustment: 0
164  maxAlignment:    0
165  adjustsStack:    false
166  hasCalls:        false
167  stackProtector:  ''
168  maxCallFrameSize: 4294967295
169  hasOpaqueSPAdjustment: false
170  hasVAStart:      false
171  hasMustTailInVarArgFunc: false
172  localFrameSize:  0
173  savePoint:       ''
174  restorePoint:    ''
175fixedStack:
176stack:
177constants:
178body:             |
179  bb.1 (%ir-block.0):
180    liveins: $edi, $esi
181
182    ; CHECK-LABEL: name: test_udiv_i32
183    ; CHECK: liveins: $edi, $esi
184    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
185    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
186    ; CHECK: [[UDIV:%[0-9]+]]:_(s32) = G_UDIV [[COPY]], [[COPY1]]
187    ; CHECK: $eax = COPY [[UDIV]](s32)
188    ; CHECK: RET 0, implicit $eax
189    %0:_(s32) = COPY $edi
190    %1:_(s32) = COPY $esi
191    %2:_(s32) = G_UDIV %0, %1
192    $eax = COPY %2(s32)
193    RET 0, implicit $eax
194
195...
196