1 # RUN: llc %s -emit-call-site-info -run-pass=block-placement -tail-dup-placement-threshold=4 -o - | FileCheck %s
3 # Test case adapted from test/CodeGen/X86/taildup-heapallocsite.ll.
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' } }
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"
15 define dso_local void @taildupit(ptr readonly %size_ptr) {
17 %tobool = icmp eq ptr %size_ptr, null
18 br i1 %tobool, label %cond.end, label %cond.true
20 cond.true: ; preds = %entry
21 %0 = load i32, ptr %size_ptr, align 4
24 cond.end: ; preds = %cond.true, %entry
25 %cond = phi i32 [ %0, %cond.true ], [ 1, %entry ]
26 %call = tail call ptr @alloc(i32 %cond)
31 declare dso_local ptr @alloc(i32)
33 declare dso_local void @f2()
38 tracksRegLiveness: true
40 - { reg: '$rcx', virtual-reg: '' }
42 - { bb: 3, offset: 0, fwdArgRegs:
43 - { arg: 0, reg: '$rcx' } }
46 successors: %bb.1(0x30000000), %bb.2(0x50000000)
49 $rsp = frame-setup SUB64ri8 $rsp, 40, implicit-def dead $eflags
50 frame-setup SEH_StackAlloc 40
51 frame-setup SEH_EndPrologue
52 TEST64rr renamable $rcx, renamable $rcx, implicit-def $eflags
53 JCC_1 %bb.2, 5, implicit killed $eflags
56 successors: %bb.3(0x80000000)
58 renamable $ecx = MOV32ri 1
62 successors: %bb.3(0x80000000)
65 renamable $ecx = MOV32rm killed renamable $rcx, 1, $noreg, 0, $noreg :: (load (s32) from %ir.size_ptr)
70 CALL64pcrel32 @alloc, csr_win64, implicit $rsp, implicit $ssp, implicit $ecx, implicit-def $rsp, implicit-def $ssp, implicit-def dead $rax
72 $rsp = frame-destroy ADD64ri8 $rsp, 40, implicit-def dead $eflags
73 TAILJMPd64 @f2, csr_win64, implicit $rsp, implicit $ssp, implicit $rsp, implicit $ssp