1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
4 ; %ptr has a hint to %rdi in entry block, it also has a interference with %rdi
5 ; in block if.then. It should be split in cold block if.then.
6 ; Similarly %p2, %p3, %p4, %p5 and %p6 should also be split in cold block
9 define ptr @foo(ptr %ptr, i64 %p2, i64 %p3, i64 %p4, i64 %p5, i64 %p6) {
11 ; CHECK: # %bb.0: # %entry
12 ; CHECK-NEXT: testq %rdi, %rdi
13 ; CHECK-NEXT: je .LBB0_1
14 ; CHECK-NEXT: # %bb.2: # %if.end
15 ; CHECK-NEXT: incq %rdi
16 ; CHECK-NEXT: jmp qux@PLT # TAILCALL
17 ; CHECK-NEXT: .LBB0_1: # %if.then
18 ; CHECK-NEXT: pushq %r15
19 ; CHECK-NEXT: .cfi_def_cfa_offset 16
20 ; CHECK-NEXT: pushq %r14
21 ; CHECK-NEXT: .cfi_def_cfa_offset 24
22 ; CHECK-NEXT: pushq %r13
23 ; CHECK-NEXT: .cfi_def_cfa_offset 32
24 ; CHECK-NEXT: pushq %r12
25 ; CHECK-NEXT: .cfi_def_cfa_offset 40
26 ; CHECK-NEXT: pushq %rbx
27 ; CHECK-NEXT: .cfi_def_cfa_offset 48
28 ; CHECK-NEXT: .cfi_offset %rbx, -48
29 ; CHECK-NEXT: .cfi_offset %r12, -40
30 ; CHECK-NEXT: .cfi_offset %r13, -32
31 ; CHECK-NEXT: .cfi_offset %r14, -24
32 ; CHECK-NEXT: .cfi_offset %r15, -16
33 ; CHECK-NEXT: movq %rsi, %rbx
34 ; CHECK-NEXT: movq %rdx, %r14
35 ; CHECK-NEXT: movq %rcx, %r15
36 ; CHECK-NEXT: movq %r8, %r12
37 ; CHECK-NEXT: movq %r9, %r13
38 ; CHECK-NEXT: callq bar@PLT
39 ; CHECK-NEXT: movq %rbx, %rsi
40 ; CHECK-NEXT: movq %r14, %rdx
41 ; CHECK-NEXT: movq %r15, %rcx
42 ; CHECK-NEXT: movq %r12, %r8
43 ; CHECK-NEXT: movq %r13, %r9
44 ; CHECK-NEXT: movq %rax, %rdi
45 ; CHECK-NEXT: popq %rbx
46 ; CHECK-NEXT: .cfi_def_cfa_offset 40
47 ; CHECK-NEXT: popq %r12
48 ; CHECK-NEXT: .cfi_def_cfa_offset 32
49 ; CHECK-NEXT: popq %r13
50 ; CHECK-NEXT: .cfi_def_cfa_offset 24
51 ; CHECK-NEXT: popq %r14
52 ; CHECK-NEXT: .cfi_def_cfa_offset 16
53 ; CHECK-NEXT: popq %r15
54 ; CHECK-NEXT: .cfi_def_cfa_offset 8
55 ; CHECK-NEXT: .cfi_restore %rbx
56 ; CHECK-NEXT: .cfi_restore %r12
57 ; CHECK-NEXT: .cfi_restore %r13
58 ; CHECK-NEXT: .cfi_restore %r14
59 ; CHECK-NEXT: .cfi_restore %r15
60 ; CHECK-NEXT: incq %rdi
61 ; CHECK-NEXT: jmp qux@PLT # TAILCALL
63 %tobool.not = icmp eq ptr %ptr, null
64 br i1 %tobool.not, label %if.then, label %if.end, !prof !5
66 if.then: ; preds = %entry
67 %call = tail call ptr @bar(ptr %ptr, i64 %p2, i64 %p3, i64 %p4, i64 %p5, i64 %p6)
70 if.end: ; preds = %if.then, %entry
71 %ptr.addr.0 = phi ptr [ %call, %if.then ], [ %ptr, %entry ]
72 %incdec.ptr = getelementptr inbounds i8, ptr %ptr.addr.0, i64 1
73 %call2 = tail call ptr @qux(ptr %incdec.ptr, i64 %p2, i64 %p3, i64 %p4, i64 %p5, i64 %p6)
77 !5 = !{!"branch_weights", i32 1, i32 2000}
79 declare ptr @bar(ptr, i64, i64, i64, i64, i64)
80 declare ptr @qux(ptr, i64, i64, i64, i64, i64)