Skip to content

Commit 0e9a3d3

Browse files
committed
[x86] add test for 'sbb' false dependency stall; NFC
1 parent f523e83 commit 0e9a3d3

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2+
; RUN: llc < %s -mtriple=x86_64-- -mcpu=sandybridge | FileCheck %s --check-prefixes=CHECK
3+
4+
%struct.y_s = type { i64*, i64* }
5+
6+
define i32 @mallocbench_gs(i32* noundef %0, %struct.y_s* noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) nounwind {
7+
; CHECK-LABEL: mallocbench_gs:
8+
; CHECK: # %bb.0:
9+
; CHECK-NEXT: pushq %rbp
10+
; CHECK-NEXT: pushq %r15
11+
; CHECK-NEXT: pushq %r14
12+
; CHECK-NEXT: pushq %r13
13+
; CHECK-NEXT: pushq %r12
14+
; CHECK-NEXT: pushq %rbx
15+
; CHECK-NEXT: pushq %rax
16+
; CHECK-NEXT: movl %r8d, %r13d
17+
; CHECK-NEXT: movl %ecx, %r14d
18+
; CHECK-NEXT: movl %edx, %r15d
19+
; CHECK-NEXT: movq %rsi, %rbx
20+
; CHECK-NEXT: movq %rdi, %r12
21+
; CHECK-NEXT: movq (%rsi), %rdi
22+
; CHECK-NEXT: movq 8(%rsi), %rsi
23+
; CHECK-NEXT: movq %rbx, %rdx
24+
; CHECK-NEXT: callq foo1@PLT
25+
; CHECK-NEXT: movq 8(%rbx), %rax
26+
; CHECK-NEXT: movq (%rax), %rdx
27+
; CHECK-NEXT: movl %r13d, %ecx
28+
; CHECK-NEXT: negl %ecx
29+
; CHECK-NEXT: sbbq %rbp, %rbp
30+
; CHECK-NEXT: orq %rdx, %rbp
31+
; CHECK-NEXT: cmpl $1, %r13d
32+
; CHECK-NEXT: sbbq %rax, %rax
33+
; CHECK-NEXT: orq %rdx, %rax
34+
; CHECK-NEXT: subq $8, %rsp
35+
; CHECK-NEXT: movq %r12, %rdi
36+
; CHECK-NEXT: movl %r15d, %esi
37+
; CHECK-NEXT: movl %r14d, %edx
38+
; CHECK-NEXT: xorl %ecx, %ecx
39+
; CHECK-NEXT: xorl %r8d, %r8d
40+
; CHECK-NEXT: xorl %r9d, %r9d
41+
; CHECK-NEXT: pushq %rax
42+
; CHECK-NEXT: pushq %rbp
43+
; CHECK-NEXT: pushq %rbx
44+
; CHECK-NEXT: callq foo2@PLT
45+
; CHECK-NEXT: addq $40, %rsp
46+
; CHECK-NEXT: popq %rbx
47+
; CHECK-NEXT: popq %r12
48+
; CHECK-NEXT: popq %r13
49+
; CHECK-NEXT: popq %r14
50+
; CHECK-NEXT: popq %r15
51+
; CHECK-NEXT: popq %rbp
52+
; CHECK-NEXT: retq
53+
%6 = getelementptr inbounds %struct.y_s, %struct.y_s* %1, i64 0, i32 0
54+
%7 = load i64*, i64** %6, align 8
55+
%8 = getelementptr inbounds %struct.y_s, %struct.y_s* %1, i64 0, i32 1
56+
%9 = load i64*, i64** %8, align 8
57+
tail call void @foo1(i64* noundef %7, i64* noundef %9, %struct.y_s* noundef %1)
58+
%10 = icmp eq i32 %4, 0
59+
%11 = load i64*, i64** %8, align 8
60+
%12 = load i64, i64* %11, align 8
61+
%13 = select i1 %10, i64 %12, i64 -1
62+
%14 = select i1 %10, i64 -1, i64 %12
63+
%15 = tail call noundef i32 @foo2(i32* noundef %0, i32 noundef %2, i32 noundef %3, i32 noundef 0, i32 noundef 0, i32 noundef 0, %struct.y_s* noundef nonnull %1, i64 noundef %13, i64 noundef %14)
64+
ret i32 %15
65+
}
66+
67+
declare void @foo1(i64* noundef, i64* noundef, %struct.y_s* noundef) local_unnamed_addr #1
68+
declare noundef i32 @foo2(i32* noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, %struct.y_s* noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

0 commit comments

Comments
 (0)