77 lines · plain
1# RUN: llc %s -emit-call-site-info -run-pass=block-placement -tail-dup-placement-threshold=4 -o - | FileCheck %s2#3# Test case adapted from test/CodeGen/X86/taildup-heapallocsite.ll.4 5# CHECK-LABEL: callSites:6# CHECK-NEXT: - { bb: 1, offset: 1, fwdArgRegs:7# CHECK-NEXT: - { arg: 0, reg: '$rcx' } }8# CHECK-NEXT: - { bb: 2, offset: 1, fwdArgRegs:9# CHECK-NEXT: - { arg: 0, reg: '$rcx' } }10 11--- |12 target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"13 target triple = "x86_64-pc-windows-msvc19.22.27905"14 15 define dso_local void @taildupit(ptr readonly %size_ptr) {16 entry:17 %tobool = icmp eq ptr %size_ptr, null18 br i1 %tobool, label %cond.end, label %cond.true19 20 cond.true: ; preds = %entry21 %0 = load i32, ptr %size_ptr, align 422 br label %cond.end23 24 cond.end: ; preds = %cond.true, %entry25 %cond = phi i32 [ %0, %cond.true ], [ 1, %entry ]26 %call = tail call ptr @alloc(i32 %cond)27 tail call void @f2()28 ret void29 }30 31 declare dso_local ptr @alloc(i32)32 33 declare dso_local void @f2()34 35...36---37name: taildupit38tracksRegLiveness: true39liveins:40 - { reg: '$rcx', virtual-reg: '' }41callSites:42 - { bb: 3, offset: 0, fwdArgRegs:43 - { arg: 0, reg: '$rcx' } }44body: |45 bb.0.entry:46 successors: %bb.1(0x30000000), %bb.2(0x50000000)47 liveins: $rcx48 49 $rsp = frame-setup SUB64ri8 $rsp, 40, implicit-def dead $eflags50 frame-setup SEH_StackAlloc 4051 frame-setup SEH_EndPrologue52 TEST64rr renamable $rcx, renamable $rcx, implicit-def $eflags53 JCC_1 %bb.2, 5, implicit killed $eflags54 55 bb.1:56 successors: %bb.3(0x80000000)57 58 renamable $ecx = MOV32ri 159 JMP_1 %bb.360 61 bb.2.cond.true:62 successors: %bb.3(0x80000000)63 liveins: $rcx64 65 renamable $ecx = MOV32rm killed renamable $rcx, 1, $noreg, 0, $noreg :: (load (s32) from %ir.size_ptr)66 67 bb.3.cond.end:68 liveins: $ecx69 70 CALL64pcrel32 @alloc, csr_win64, implicit $rsp, implicit $ssp, implicit $ecx, implicit-def $rsp, implicit-def $ssp, implicit-def dead $rax71 SEH_BeginEpilogue72 $rsp = frame-destroy ADD64ri8 $rsp, 40, implicit-def dead $eflags73 SEH_EndEpilogue74 TAILJMPd64 @f2, csr_win64, implicit $rsp, implicit $ssp, implicit $rsp, implicit $ssp75 76...77