File: shrink-wrap-chkstk-x86_64.ll

package info (click to toggle)
llvm-toolchain-7 1%3A7.0.1-8%2Bdeb10u2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 734,616 kB
  • sloc: cpp: 3,776,926; ansic: 633,271; asm: 350,301; python: 142,716; objc: 107,612; sh: 22,626; lisp: 11,056; perl: 7,999; pascal: 6,742; ml: 5,537; awk: 3,536; makefile: 2,557; cs: 2,027; xml: 841; javascript: 518; ruby: 156
file content (36 lines) | stat: -rw-r--r-- 1,062 bytes parent folder | download | duplicates (3)
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
; RUN: llc -mtriple=x86_64-windows-gnu -exception-model=dwarf < %s | FileCheck %s

%struct.A = type { [4096 x i8] }

@a = common global i32 0, align 4
@b = common global i32 0, align 4

define void @fn1() nounwind uwtable {
entry:
  %ctx = alloca %struct.A, align 1
  %0 = load i32, i32* @a, align 4
  %tobool = icmp eq i32 %0, 0
  %div = sdiv i32 %0, 6
  %cond = select i1 %tobool, i32 %div, i32 %0
  store i32 %cond, i32* @b, align 4
  %1 = getelementptr inbounds %struct.A, %struct.A* %ctx, i64 0, i32 0, i64 0
  call void @llvm.lifetime.start.p0i8(i64 4096, i8* nonnull %1)
  %2 = ptrtoint %struct.A* %ctx to i64
  %3 = trunc i64 %2 to i32
  call void @fn2(i32 %3)
  call void @llvm.lifetime.end.p0i8(i64 4096, i8* nonnull %1)
  ret void
}

declare void @fn2(i32)
declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)

; CHECK-LABEL: fn1:
; CHECK: pushq %rax
; CHECK: movl $4128, %eax
; CHECK: callq ___chkstk_ms
; CHECK: subq %rax, %rsp
; CHECK: movq 4128(%rsp), %rax

; CHECK: addq $4136, %rsp