1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -relocation-model=pic -post-RA-scheduler=1 -break-anti-dependencies=critical | FileCheck %s
4 ; PR20308 ( http://llvm.org/bugs/show_bug.cgi?id=20308 ).
5 ; The critical-anti-dependency-breaker must not use register def information from a kill inst.
6 ; This test case expects such an instruction to appear as a comment with def info for RDI.
7 ; There is an anti-dependency (WAR) hazard using RAX using default reg allocation and scheduling.
8 ; The post-RA-scheduler and critical-anti-dependency breaker can eliminate that hazard using R10.
9 ; That is the first free register that isn't used as a param in the call to "@Image".
11 @PartClass = external global i32
12 @NullToken = external global i64
14 define i32 @Part_Create(ptr %Anchor, i32 %TypeNum, i32 %F, i32 %Z, ptr %Status, ptr %PartTkn) {
15 ; CHECK-LABEL: Part_Create:
17 ; CHECK-NEXT: pushq %rbp
18 ; CHECK-NEXT: .cfi_def_cfa_offset 16
19 ; CHECK-NEXT: pushq %rbx
20 ; CHECK-NEXT: .cfi_def_cfa_offset 24
21 ; CHECK-NEXT: subq $24, %rsp
22 ; CHECK-NEXT: .cfi_def_cfa_offset 48
23 ; CHECK-NEXT: .cfi_offset %rbx, -24
24 ; CHECK-NEXT: .cfi_offset %rbp, -16
25 ; CHECK-NEXT: movq NullToken@GOTPCREL(%rip), %rax
26 ; CHECK-NEXT: movq PartClass@GOTPCREL(%rip), %r10
27 ; CHECK-NEXT: xorl %edx, %edx
28 ; CHECK-NEXT: xorl %ecx, %ecx
29 ; CHECK-NEXT: movq %rdi, %rbx
30 ; CHECK-NEXT: movq (%rax), %rax
31 ; CHECK-NEXT: movl (%r10), %ebp
32 ; CHECK-NEXT: movq %rax, {{[0-9]+}}(%rsp)
33 ; CHECK-NEXT: leaq {{[0-9]+}}(%rsp), %rax
34 ; CHECK-NEXT: movl %ebp, %esi
35 ; CHECK-NEXT: movq %rax, (%rsp)
36 ; CHECK-NEXT: callq Image@PLT
37 ; CHECK-NEXT: movq %rbx, %rdi
38 ; CHECK-NEXT: callq Create@PLT
39 ; CHECK-NEXT: movl %ebp, %eax
40 ; CHECK-NEXT: addq $24, %rsp
41 ; CHECK-NEXT: .cfi_def_cfa_offset 24
42 ; CHECK-NEXT: popq %rbx
43 ; CHECK-NEXT: .cfi_def_cfa_offset 16
44 ; CHECK-NEXT: popq %rbp
45 ; CHECK-NEXT: .cfi_def_cfa_offset 8
47 %PartObj = alloca ptr, align 8
48 %Vchunk = alloca i64, align 8
49 %1 = load i64, ptr @NullToken, align 4
50 store i64 %1, ptr %Vchunk, align 8
51 %2 = load i32, ptr @PartClass, align 4
52 call i32 @Image(ptr %Anchor, i32 %2, i32 0, i32 0, ptr %Status, ptr %PartTkn, ptr %PartObj)
53 call i32 @Create(ptr %Anchor)
57 declare i32 @Image(ptr, i32, i32, i32, ptr, ptr, ptr)
58 declare i32 @Create(ptr)