2 # RUN: llc -mtriple=x86_64-- -run-pass=greedy %s -debug-only=regalloc -huge-size-for-split=0 -o /dev/null 2>&1 | FileCheck %s
3 # Check no global region split is needed because the live range to split is trivially rematerializable.
4 # CHECK-NOT: Compact region bundles
7 source_filename = "2.cc"
8 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
9 target triple = "x86_64-unknown-linux-gnu"
11 @m = local_unnamed_addr global i32 0, align 4
12 @.str = private unnamed_addr constant [4 x i8] c"abc\00", align 1
13 @.str.1 = private unnamed_addr constant [4 x i8] c"def\00", align 1
14 @.str.2 = private unnamed_addr constant [4 x i8] c"ghi\00", align 1
16 ; Function Attrs: uwtable
17 define void @_Z3fooi(i32 %value) local_unnamed_addr #0 {
21 do.body: ; preds = %do.cond, %entry
22 tail call void asm sideeffect "", "~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{dirflag},~{fpsr},~{flags}"() #2, !srcloc !3
23 switch i32 %value, label %do.cond [
29 sw.bb: ; preds = %do.body
30 tail call void @_Z3gooPKc(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
33 sw.bb1: ; preds = %sw.bb, %do.body
34 tail call void @_Z3gooPKc(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
37 sw.bb2: ; preds = %sw.bb1, %do.body
38 tail call void @_Z3gooPKc(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
41 do.cond: ; preds = %sw.bb2, %do.body
42 %0 = load i32, i32* @m, align 4, !tbaa !4
43 %cmp = icmp eq i32 %0, 5
44 br i1 %cmp, label %do.end, label %do.body
46 do.end: ; preds = %do.cond
50 declare void @_Z3gooPKc(i8*) local_unnamed_addr #1
52 ; Function Attrs: nounwind
53 declare void @llvm.stackprotector(i8*, i8**) #2
55 attributes #0 = { uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
56 attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
57 attributes #2 = { nounwind }
59 !llvm.module.flags = !{!0, !1}
62 !0 = !{i32 1, !"wchar_size", i32 4}
63 !1 = !{i32 7, !"PIC Level", i32 2}
64 !2 = !{!"clang version 7.0.0 (trunk 335057)"}
67 !5 = !{!"int", !6, i64 0}
68 !6 = !{!"omnipotent char", !7, i64 0}
69 !7 = !{!"Simple C++ TBAA"}
75 tracksRegLiveness: true
77 - { id: 0, class: gr32 }
78 - { id: 1, class: gr32 }
79 - { id: 2, class: gr32 }
80 - { id: 3, class: gr64 }
81 - { id: 4, class: gr64 }
82 - { id: 5, class: gr64 }
83 - { id: 6, class: gr64 }
84 - { id: 7, class: gr32 }
85 - { id: 8, class: gr32 }
87 - { reg: '$edi', virtual-reg: '%0' }
95 %5:gr64 = LEA64r $rip, 1, $noreg, @.str.2, $noreg
96 %6:gr64 = MOV64rm $rip, 1, $noreg, target-flags(x86-gotpcrel) @m, $noreg :: (load 8 from got)
97 %4:gr64 = LEA64r $rip, 1, $noreg, @.str.1, $noreg
98 %3:gr64 = LEA64r $rip, 1, $noreg, @.str, $noreg
101 successors: %bb.6(0x20000000), %bb.2(0x60000000)
103 INLINEASM &"", 1, 12, implicit-def dead early-clobber $r10, 12, implicit-def dead early-clobber $r11, 12, implicit-def dead early-clobber $r12, 12, implicit-def dead early-clobber $r13, 12, implicit-def dead early-clobber $r14, 12, implicit-def dead early-clobber $r15, 12, implicit-def dead early-clobber $eflags, !3
104 CMP32ri8 %0, 2, implicit-def $eflags
105 JCC_1 %bb.6, 4, implicit killed $eflags
109 successors: %bb.5(0x2aaaaaab), %bb.3(0x55555555)
111 CMP32ri8 %0, 1, implicit-def $eflags
112 JCC_1 %bb.5, 4, implicit killed $eflags
116 successors: %bb.4, %bb.7
118 TEST32rr %0, %0, implicit-def $eflags
119 JCC_1 %bb.7, 5, implicit killed $eflags
123 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
125 CALL64pcrel32 target-flags(x86-plt) @_Z3gooPKc, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp
126 ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
129 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
131 CALL64pcrel32 target-flags(x86-plt) @_Z3gooPKc, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp
132 ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
135 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
137 CALL64pcrel32 target-flags(x86-plt) @_Z3gooPKc, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp
138 ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
141 successors: %bb.8(0x04000000), %bb.1(0x7c000000)
143 CMP32mi8 %6, 1, $noreg, 0, $noreg, 5, implicit-def $eflags :: (dereferenceable load 4 from @m, !tbaa !4)
144 JCC_1 %bb.1, 5, implicit killed $eflags