File: sbb-false-dep.ll

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (117 lines) | stat: -rw-r--r-- 4,134 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64--                          | FileCheck %s --check-prefixes=CHECK
; RUN: llc < %s -mtriple=x86_64-- -mattr=+sbb-dep-breaking | FileCheck %s --check-prefixes=IDIOM

%struct.y_s = type { ptr, ptr }

define i32 @mallocbench_gs(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) nounwind {
; CHECK-LABEL: mallocbench_gs:
; CHECK:       # %bb.0:
; CHECK-NEXT:    pushq %rbp
; CHECK-NEXT:    pushq %r15
; CHECK-NEXT:    pushq %r14
; CHECK-NEXT:    pushq %r13
; CHECK-NEXT:    pushq %r12
; CHECK-NEXT:    pushq %rbx
; CHECK-NEXT:    pushq %rax
; CHECK-NEXT:    movl %r8d, %r13d
; CHECK-NEXT:    movl %ecx, %r14d
; CHECK-NEXT:    movl %edx, %r15d
; CHECK-NEXT:    movq %rsi, %rbx
; CHECK-NEXT:    movq %rdi, %r12
; CHECK-NEXT:    movq (%rsi), %rdi
; CHECK-NEXT:    movq 8(%rsi), %rsi
; CHECK-NEXT:    movq %rbx, %rdx
; CHECK-NEXT:    callq foo1@PLT
; CHECK-NEXT:    movq 8(%rbx), %rax
; CHECK-NEXT:    movq (%rax), %rdx
; CHECK-NEXT:    xorl %ebp, %ebp
; CHECK-NEXT:    movl %r13d, %ecx
; CHECK-NEXT:    negl %ecx
; CHECK-NEXT:    movl $0, %eax
; CHECK-NEXT:    sbbq %rax, %rax
; CHECK-NEXT:    orq %rdx, %rax
; CHECK-NEXT:    cmpl $1, %r13d
; CHECK-NEXT:    sbbq %rbp, %rbp
; CHECK-NEXT:    orq %rdx, %rbp
; CHECK-NEXT:    subq $8, %rsp
; CHECK-NEXT:    movq %r12, %rdi
; CHECK-NEXT:    movl %r15d, %esi
; CHECK-NEXT:    movl %r14d, %edx
; CHECK-NEXT:    xorl %ecx, %ecx
; CHECK-NEXT:    xorl %r8d, %r8d
; CHECK-NEXT:    xorl %r9d, %r9d
; CHECK-NEXT:    pushq %rbp
; CHECK-NEXT:    pushq %rax
; CHECK-NEXT:    pushq %rbx
; CHECK-NEXT:    callq foo2@PLT
; CHECK-NEXT:    addq $40, %rsp
; CHECK-NEXT:    popq %rbx
; CHECK-NEXT:    popq %r12
; CHECK-NEXT:    popq %r13
; CHECK-NEXT:    popq %r14
; CHECK-NEXT:    popq %r15
; CHECK-NEXT:    popq %rbp
; CHECK-NEXT:    retq
;
; IDIOM-LABEL: mallocbench_gs:
; IDIOM:       # %bb.0:
; IDIOM-NEXT:    pushq %rbp
; IDIOM-NEXT:    pushq %r15
; IDIOM-NEXT:    pushq %r14
; IDIOM-NEXT:    pushq %r13
; IDIOM-NEXT:    pushq %r12
; IDIOM-NEXT:    pushq %rbx
; IDIOM-NEXT:    pushq %rax
; IDIOM-NEXT:    movl %r8d, %r13d
; IDIOM-NEXT:    movl %ecx, %r14d
; IDIOM-NEXT:    movl %edx, %r15d
; IDIOM-NEXT:    movq %rsi, %rbx
; IDIOM-NEXT:    movq %rdi, %r12
; IDIOM-NEXT:    movq (%rsi), %rdi
; IDIOM-NEXT:    movq 8(%rsi), %rsi
; IDIOM-NEXT:    movq %rbx, %rdx
; IDIOM-NEXT:    callq foo1@PLT
; IDIOM-NEXT:    movq 8(%rbx), %rax
; IDIOM-NEXT:    movq (%rax), %rdx
; IDIOM-NEXT:    movl %r13d, %ecx
; IDIOM-NEXT:    negl %ecx
; IDIOM-NEXT:    sbbq %rbp, %rbp
; IDIOM-NEXT:    orq %rdx, %rbp
; IDIOM-NEXT:    cmpl $1, %r13d
; IDIOM-NEXT:    sbbq %rax, %rax
; IDIOM-NEXT:    orq %rdx, %rax
; IDIOM-NEXT:    subq $8, %rsp
; IDIOM-NEXT:    movq %r12, %rdi
; IDIOM-NEXT:    movl %r15d, %esi
; IDIOM-NEXT:    movl %r14d, %edx
; IDIOM-NEXT:    xorl %ecx, %ecx
; IDIOM-NEXT:    xorl %r8d, %r8d
; IDIOM-NEXT:    xorl %r9d, %r9d
; IDIOM-NEXT:    pushq %rax
; IDIOM-NEXT:    pushq %rbp
; IDIOM-NEXT:    pushq %rbx
; IDIOM-NEXT:    callq foo2@PLT
; IDIOM-NEXT:    addq $40, %rsp
; IDIOM-NEXT:    popq %rbx
; IDIOM-NEXT:    popq %r12
; IDIOM-NEXT:    popq %r13
; IDIOM-NEXT:    popq %r14
; IDIOM-NEXT:    popq %r15
; IDIOM-NEXT:    popq %rbp
; IDIOM-NEXT:    retq
  %6 = load ptr, ptr %1, align 8
  %7 = getelementptr inbounds %struct.y_s, ptr %1, i64 0, i32 1
  %8 = load ptr, ptr %7, align 8
  tail call void @foo1(ptr noundef %6, ptr noundef %8, ptr noundef %1)
  %9 = icmp eq i32 %4, 0
  %10 = load ptr, ptr %7, align 8
  %11 = load i64, ptr %10, align 8
  %12 = select i1 %9, i64 %11, i64 -1
  %13 = select i1 %9, i64 -1, i64 %11
  %14 = tail call noundef i32 @foo2(ptr noundef %0, i32 noundef %2, i32 noundef %3, i32 noundef 0, i32 noundef 0, i32 noundef 0, ptr noundef nonnull %1, i64 noundef %12, i64 noundef %13)
  ret i32 %14
}

declare void @foo1(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1
declare noundef i32 @foo2(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #1