1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 3
2 # RUN: llc -start-after=finalize-isel -regalloc=greedy -stop-after=greedy \
3 # RUN: -verify-machineinstrs -verify-regalloc %s -o - | FileCheck %s
5 target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128"
6 target triple = "i386-unknown-linux-gnu"
8 define void @input(i32 %0) #0 {
9 call void asm "# $0", "rm,~{ax},~{cx},~{dx},~{si},~{di},~{bx},~{bp}"(i32 %0)
13 define i32 @output() #0 {
14 %1 = alloca i32, align 4
15 call void asm "# $0", "=*rm,~{ax},~{cx},~{dx},~{si},~{di},~{bx},~{bp}"(ptr nonnull elementtype(i32) %1)
16 %2 = load i32, ptr %1, align 4
20 define i32 @inout(i32 %0) #0 {
21 %2 = alloca i32, align 4
22 store i32 %0, ptr %2, align 4
23 call void asm "# $0 $1", "=*rm,0,~{ax},~{cx},~{dx},~{si},~{di},~{bx},~{bp}"(ptr nonnull elementtype(i32) %2, i32 %0)
24 %3 = load i32, ptr %2, align 4
28 attributes #0 = { nounwind }
34 exposesReturnsTwice: false
36 regBankSelected: false
39 tracksRegLiveness: true
42 callsUnwindInit: false
48 failsVerification: false
49 tracksDebugUserValues: false
51 - { id: 0, class: gr32, preferred-register: '' }
54 isFrameAddressTaken: false
55 isReturnAddressTaken: false
65 maxCallFrameSize: 4294967295
66 cvBytesOfCalleeSavedRegisters: 0
67 hasOpaqueSPAdjustment: false
69 hasMustTailInVarArgFunc: false
75 - { id: 0, type: default, offset: 0, size: 4, alignment: 16, stack-id: default,
76 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
77 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
81 debugValueSubstitutions: []
83 machineFunctionInfo: {}
86 ; CHECK-LABEL: name: input
87 ; CHECK: INLINEASM &"# $0", 8 /* mayload attdialect */, 262190 /* mem:m */, %fixed-stack.0, 1, $noreg, 0, $noreg, 12 /* clobber */, implicit-def dead early-clobber $ax, 12 /* clobber */, implicit-def dead early-clobber $cx, 12 /* clobber */, implicit-def dead early-clobber $dx, 12 /* clobber */, implicit-def dead early-clobber $si, 12 /* clobber */, implicit-def dead early-clobber $di, 12 /* clobber */, implicit-def dead early-clobber $bx, 12 /* clobber */, implicit-def dead early-clobber $bp :: (load (s32) from %fixed-stack.0, align 16)
89 %0:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (load (s32) from %fixed-stack.0, align 16)
90 INLINEASM &"# $0", 0 /* attdialect */, 1076101129 /* reguse:GR32 spillable */, %0, 12 /* clobber */, implicit-def early-clobber $ax, 12 /* clobber */, implicit-def early-clobber $cx, 12 /* clobber */, implicit-def early-clobber $dx, 12 /* clobber */, implicit-def early-clobber $si, 12 /* clobber */, implicit-def early-clobber $di, 12 /* clobber */, implicit-def early-clobber $bx, 12 /* clobber */, implicit-def early-clobber $bp
97 exposesReturnsTwice: false
99 regBankSelected: false
102 tracksRegLiveness: true
105 callsUnwindInit: false
111 failsVerification: false
112 tracksDebugUserValues: false
114 - { id: 0, class: gr32, preferred-register: '' }
117 isFrameAddressTaken: false
118 isReturnAddressTaken: false
128 maxCallFrameSize: 4294967295
129 cvBytesOfCalleeSavedRegisters: 0
130 hasOpaqueSPAdjustment: false
132 hasMustTailInVarArgFunc: false
139 - { id: 0, name: '', type: default, offset: 0, size: 4, alignment: 4,
140 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
141 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
144 debugValueSubstitutions: []
146 machineFunctionInfo: {}
149 ; CHECK-LABEL: name: output
150 ; CHECK: INLINEASM &"# $0", 16 /* maystore attdialect */, 262190 /* mem:m */, %stack.1, 1, $noreg, 0, $noreg, 12 /* clobber */, implicit-def dead early-clobber $ax, 12 /* clobber */, implicit-def dead early-clobber $cx, 12 /* clobber */, implicit-def dead early-clobber $dx, 12 /* clobber */, implicit-def dead early-clobber $si, 12 /* clobber */, implicit-def dead early-clobber $di, 12 /* clobber */, implicit-def dead early-clobber $bx, 12 /* clobber */, implicit-def dead early-clobber $bp :: (store (s32) into %stack.1)
151 ; CHECK-NEXT: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %stack.1, 1, $noreg, 0, $noreg :: (load (s32) from %stack.1)
152 ; CHECK-NEXT: MOV32mr %stack.0, 1, $noreg, 0, $noreg, [[MOV32rm]] :: (store (s32) into %ir.1)
153 ; CHECK-NEXT: $eax = COPY [[MOV32rm]]
154 ; CHECK-NEXT: RET 0, $eax
155 INLINEASM &"# $0", 0 /* attdialect */, 1076101130 /* regdef:GR32 spillable */, def %0, 12 /* clobber */, implicit-def early-clobber $ax, 12 /* clobber */, implicit-def early-clobber $cx, 12 /* clobber */, implicit-def early-clobber $dx, 12 /* clobber */, implicit-def early-clobber $si, 12 /* clobber */, implicit-def early-clobber $di, 12 /* clobber */, implicit-def early-clobber $bx, 12 /* clobber */, implicit-def early-clobber $bp
156 MOV32mr %stack.0, 1, $noreg, 0, $noreg, %0 :: (store (s32) into %ir.1)
164 exposesReturnsTwice: false
166 regBankSelected: false
169 tracksRegLiveness: true
172 callsUnwindInit: false
178 failsVerification: false
179 tracksDebugUserValues: false
181 - { id: 0, class: gr32, preferred-register: '' }
182 - { id: 1, class: gr32, preferred-register: '' }
185 isFrameAddressTaken: false
186 isReturnAddressTaken: false
196 maxCallFrameSize: 4294967295
197 cvBytesOfCalleeSavedRegisters: 0
198 hasOpaqueSPAdjustment: false
200 hasMustTailInVarArgFunc: false
206 - { id: 0, type: default, offset: 0, size: 4, alignment: 16, stack-id: default,
207 isImmutable: false, isAliased: false, callee-saved-register: '',
208 callee-saved-restored: true, debug-info-variable: '', debug-info-expression: '',
209 debug-info-location: '' }
213 debugValueSubstitutions: []
215 machineFunctionInfo: {}
218 ; CHECK-LABEL: name: inout
219 ; CHECK: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (load (s32) from %fixed-stack.0, align 16)
220 ; CHECK-NEXT: MOV32mr %stack.0, 1, $noreg, 0, $noreg, [[MOV32rm]] :: (store (s32) into %stack.0)
221 ; CHECK-NEXT: INLINEASM &"# $0 $1", 24 /* mayload maystore attdialect */, 262190 /* mem:m */, %stack.0, 1, $noreg, 0, $noreg, 262190 /* mem:m */, %stack.0, 1, $noreg, 0, $noreg, 12 /* clobber */, implicit-def dead early-clobber $ax, 12 /* clobber */, implicit-def dead early-clobber $cx, 12 /* clobber */, implicit-def dead early-clobber $dx, 12 /* clobber */, implicit-def dead early-clobber $si, 12 /* clobber */, implicit-def dead early-clobber $di, 12 /* clobber */, implicit-def dead early-clobber $bx, 12 /* clobber */, implicit-def dead early-clobber $bp :: (load store (s32) on %stack.0)
222 ; CHECK-NEXT: [[MOV32rm1:%[0-9]+]]:gr32 = MOV32rm %stack.0, 1, $noreg, 0, $noreg :: (load (s32) from %stack.0)
223 ; CHECK-NEXT: MOV32mr %fixed-stack.0, 1, $noreg, 0, $noreg, [[MOV32rm1]] :: (store (s32) into %ir.2, align 16)
224 ; CHECK-NEXT: $eax = COPY [[MOV32rm1]]
225 ; CHECK-NEXT: RET 0, $eax
226 %1:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (load (s32) from %fixed-stack.0, align 16)
227 INLINEASM &"# $0 $1", 0 /* attdialect */, 1076101130 /* regdef:GR32 spillable */, def %0, 2147483657 /* reguse tiedto:$0 */, %1(tied-def 3), 12 /* clobber */, implicit-def early-clobber $ax, 12 /* clobber */, implicit-def early-clobber $cx, 12 /* clobber */, implicit-def early-clobber $dx, 12 /* clobber */, implicit-def early-clobber $si, 12 /* clobber */, implicit-def early-clobber $di, 12 /* clobber */, implicit-def early-clobber $bx, 12 /* clobber */, implicit-def early-clobber $bp
228 MOV32mr %fixed-stack.0, 1, $noreg, 0, $noreg, %0 :: (store (s32) into %ir.2, align 16)