120 lines · plain
1# REQUIRES: asserts2# RUN: llc -mtriple=x86_64-- -passes=register-coalescer -late-remat-update-threshold=1 -stats %s -o /dev/null 2>&1 | FileCheck %s3# Check the test will rematerialize for three copies, but will call shrinkToUses4# only once to update live range because of late rematerialization update.5# CHECK: 3 regalloc - Number of instructions re-materialized6# CHECK: 1 regalloc - Number of shrinkToUses called7--- |8 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"9 target triple = "x86_64-unknown-linux-gnu"10 11 ; Function Attrs: noreturn uwtable12 define void @_Z3fooi(i32 %value) local_unnamed_addr #0 {13 entry:14 br label %do.body15 16 do.body: ; preds = %do.body, %sw.bb2, %entry17 tail call void asm sideeffect "", "~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{dirflag},~{fpsr},~{flags}"() #2, !srcloc !318 switch i32 %value, label %do.body [19 i32 0, label %sw.bb20 i32 1, label %sw.bb121 i32 2, label %sw.bb222 ]23 24 sw.bb: ; preds = %do.body25 tail call void @_Z3gooi(i32 2122)26 br label %sw.bb127 28 sw.bb1: ; preds = %sw.bb, %do.body29 tail call void @_Z3gooi(i32 2122)30 br label %sw.bb231 32 sw.bb2: ; preds = %sw.bb1, %do.body33 tail call void @_Z3gooi(i32 2122)34 br label %do.body35 }36 37 declare void @_Z3gooi(i32) local_unnamed_addr #138 39 ; Function Attrs: nounwind40 declare void @llvm.stackprotector(ptr, ptr) #241 42 attributes #0 = { noreturn uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "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" "use-soft-float"="false" }43 attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "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" "use-soft-float"="false" }44 attributes #2 = { nounwind }45 46 !llvm.module.flags = !{!0, !1}47 !llvm.ident = !{!2}48 49 !0 = !{i32 1, !"wchar_size", i32 4}50 !1 = !{i32 7, !"PIC Level", i32 2}51 !2 = !{!"clang version 7.0.0 (trunk 335057)"}52 !3 = !{i32 82}53 54...55---56name: _Z3fooi57alignment: 1658tracksRegLiveness: true59registers: 60 - { id: 0, class: gr32 }61 - { id: 1, class: gr32 }62 - { id: 2, class: gr32 }63 - { id: 3, class: gr32 }64 - { id: 4, class: gr32 }65 - { id: 5, class: gr32 }66liveins: 67 - { reg: '$edi', virtual-reg: '%0' }68frameInfo: 69 adjustsStack: true70 hasCalls: true71body: |72 bb.0.entry:73 liveins: $edi74 75 %0:gr32 = COPY killed $edi76 %5:gr32 = MOV32ri 212277 78 bb.1.do.body:79 successors: %bb.6(0x15555555), %bb.2(0x6aaaaaab)80 81 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, !382 CMP32ri8 %0, 2, implicit-def $eflags83 JCC_1 %bb.6, 4, implicit killed $eflags84 JMP_1 %bb.285 86 bb.2.do.body:87 successors: %bb.5(0x19999999), %bb.3(0x66666667)88 89 CMP32ri8 %0, 1, implicit-def $eflags90 JCC_1 %bb.5, 4, implicit killed $eflags91 JMP_1 %bb.392 93 bb.3.do.body:94 successors: %bb.4(0x20000000), %bb.1(0x60000000)95 96 TEST32rr %0, %0, implicit-def $eflags97 JCC_1 %bb.1, 5, implicit killed $eflags98 JMP_1 %bb.499 100 bb.4.sw.bb:101 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp102 $edi = COPY %5103 CALL64pcrel32 @_Z3gooi, csr_64, implicit $rsp, implicit $ssp, implicit killed $edi, implicit-def $rsp, implicit-def $ssp104 ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp105 106 bb.5.sw.bb1:107 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp108 $edi = COPY %5109 CALL64pcrel32 @_Z3gooi, csr_64, implicit $rsp, implicit $ssp, implicit killed $edi, implicit-def $rsp, implicit-def $ssp110 ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp111 112 bb.6.sw.bb2:113 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp114 $edi = COPY %5115 CALL64pcrel32 @_Z3gooi, csr_64, implicit $rsp, implicit $ssp, implicit killed $edi, implicit-def $rsp, implicit-def $ssp116 ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp117 JMP_1 %bb.1118 119...120