1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -run-pass=regallocfast -verify-machineinstrs %s -o - | FileCheck %s
3 # RUN: llc -passes=regallocfast -verify-machineinstrs %s -o - | FileCheck %s
6 source_filename = "x.c"
7 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
8 target triple = "x86_64-unknown-linux-gnu"
10 ; Function Attrs: noinline nounwind optnone
11 define dso_local i32 @main() #0 {
13 %retval = alloca i32, align 4
14 %x = alloca i32, align 4
15 store i32 0, ptr %retval, align 4
16 store i32 123, ptr %x, align 4
17 %0 = callbr i32 asm "mov $1, $0\0A\09jmp ${2:l}", "=r,r,!i,~{dirflag},~{fpsr},~{flags}"(i32 45) #2
18 to label %asm.fallthrough [label %label.split], !srcloc !5
20 asm.fallthrough: ; preds = %entry
21 store i32 %0, ptr %x, align 4
22 store i32 6, ptr %x, align 4
25 label: ; preds = %asm.fallthrough, %label.split
26 %1 = load i32, ptr %x, align 4
29 label.split: ; preds = %entry
30 %2 = call i32 @llvm.callbr.landingpad.i32(i32 %0)
31 store i32 %2, ptr %x, align 4
35 ; Function Attrs: nomerge nounwind
36 declare i32 @llvm.callbr.landingpad.i32(i32) #1
38 attributes #0 = { noinline nounwind optnone "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
39 attributes #1 = { nomerge nounwind }
40 attributes #2 = { nounwind memory(none) }
42 !llvm.module.flags = !{!0, !1, !2, !3}
45 !0 = !{i32 1, !"wchar_size", i32 4}
46 !1 = !{i32 8, !"PIC Level", i32 2}
47 !2 = !{i32 7, !"PIE Level", i32 2}
48 !3 = !{i32 7, !"frame-pointer", i32 2}
49 !4 = !{!"clang version 17.0.0 (git@github.com:llvm/llvm-project.git cf86855c4453d029a9b9ed8c4c4c18cefc1bc895)"}
50 !5 = !{i64 166, i64 179}
56 exposesReturnsTwice: false
58 regBankSelected: false
61 tracksRegLiveness: true
64 callsUnwindInit: false
69 failsVerification: false
70 tracksDebugUserValues: false
72 - { id: 0, class: gr32, preferred-register: '' }
73 - { id: 1, class: gr32, preferred-register: '' }
74 - { id: 2, class: gr32, preferred-register: '' }
75 - { id: 3, class: gr32, preferred-register: '' }
76 - { id: 4, class: gr32, preferred-register: '' }
77 - { id: 5, class: gr32, preferred-register: '' }
78 - { id: 6, class: gr32, preferred-register: '' }
81 isFrameAddressTaken: false
82 isReturnAddressTaken: false
92 maxCallFrameSize: 4294967295
93 cvBytesOfCalleeSavedRegisters: 0
94 hasOpaqueSPAdjustment: false
96 hasMustTailInVarArgFunc: false
103 - { id: 0, name: retval, type: default, offset: 0, size: 4, alignment: 4,
104 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
105 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
106 - { id: 1, name: x, type: default, offset: 0, size: 4, alignment: 4,
107 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
108 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
110 debugValueSubstitutions: []
112 machineFunctionInfo: {}
114 ; CHECK-LABEL: name: main
116 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.3(0x40000000)
118 ; CHECK-NEXT: MOV32mi %stack.0.retval, 1, $noreg, 0, $noreg, 0 :: (store (s32) into %ir.retval)
119 ; CHECK-NEXT: MOV32mi %stack.1.x, 1, $noreg, 0, $noreg, 123 :: (store (s32) into %ir.x)
120 ; CHECK-NEXT: renamable $eax = MOV32ri 45
121 ; CHECK-NEXT: INLINEASM_BR &"mov $1, $0\0A\09jmp ${2:l}", 0 /* attdialect */, 2359306 /* regdef:GR32 */, def renamable $eax, 2359305 /* reguse:GR32 */, killed renamable $eax, 13 /* imm */, %bb.3, 12 /* clobber */, implicit-def dead early-clobber $df, 12 /* clobber */, implicit-def early-clobber $fpsw, 12 /* clobber */, implicit-def dead early-clobber $eflags, !5
122 ; CHECK-NEXT: MOV32mr %stack.3, 1, $noreg, 0, $noreg, $eax :: (store (s32) into %stack.3)
123 ; CHECK-NEXT: MOV32mr %stack.2, 1, $noreg, 0, $noreg, killed $eax :: (store (s32) into %stack.2)
124 ; CHECK-NEXT: JMP_1 %bb.1
126 ; CHECK-NEXT: bb.1.asm.fallthrough:
127 ; CHECK-NEXT: successors: %bb.2(0x80000000)
129 ; CHECK-NEXT: $eax = MOV32rm %stack.2, 1, $noreg, 0, $noreg :: (load (s32) from %stack.2)
130 ; CHECK-NEXT: MOV32mr %stack.1.x, 1, $noreg, 0, $noreg, renamable $eax :: (store (s32) into %ir.x)
131 ; CHECK-NEXT: MOV32mi %stack.1.x, 1, $noreg, 0, $noreg, 6 :: (store (s32) into %ir.x)
133 ; CHECK-NEXT: bb.2.label:
134 ; CHECK-NEXT: renamable $eax = MOV32rm %stack.1.x, 1, $noreg, 0, $noreg :: (load (s32) from %ir.x)
135 ; CHECK-NEXT: RET64 implicit killed $eax
137 ; CHECK-NEXT: bb.3.label.split (machine-block-address-taken, inlineasm-br-indirect-target):
138 ; CHECK-NEXT: successors: %bb.2(0x80000000)
139 ; CHECK-NEXT: liveins: $eax
141 ; CHECK-NEXT: MOV32mr %stack.3, 1, $noreg, 0, $noreg, $eax :: (store (s32) into %stack.3)
142 ; CHECK-NEXT: $eax = MOV32rm %stack.3, 1, $noreg, 0, $noreg :: (load (s32) from %stack.3)
143 ; CHECK-NEXT: MOV32mr %stack.1.x, 1, $noreg, 0, $noreg, killed renamable $eax :: (store (s32) into %ir.x)
144 ; CHECK-NEXT: JMP_1 %bb.2
146 successors: %bb.1(0x40000000), %bb.3(0x40000000)
148 MOV32mi %stack.0.retval, 1, $noreg, 0, $noreg, 0 :: (store (s32) into %ir.retval)
149 MOV32mi %stack.1.x, 1, $noreg, 0, $noreg, 123 :: (store (s32) into %ir.x)
151 INLINEASM_BR &"mov $1, $0\0A\09jmp ${2:l}", 0 /* attdialect */, 2359306 /* regdef:GR32 */, def %1, 2359305 /* reguse:GR32 */, %2, 13 /* imm */, %bb.3, 12 /* clobber */, implicit-def early-clobber $df, 12 /* clobber */, implicit-def early-clobber $fpsw, 12 /* clobber */, implicit-def early-clobber $eflags, !5
155 bb.1.asm.fallthrough:
156 successors: %bb.2(0x80000000)
158 MOV32mr %stack.1.x, 1, $noreg, 0, $noreg, %0 :: (store (s32) into %ir.x)
159 MOV32mi %stack.1.x, 1, $noreg, 0, $noreg, 6 :: (store (s32) into %ir.x)
162 %6:gr32 = MOV32rm %stack.1.x, 1, $noreg, 0, $noreg :: (load (s32) from %ir.x)
166 bb.3.label.split (machine-block-address-taken, inlineasm-br-indirect-target):
167 successors: %bb.2(0x80000000)
170 MOV32mr %stack.1.x, 1, $noreg, 0, $noreg, %3 :: (store (s32) into %ir.x)