File: i686-win-shrink-wrapping.ll

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (40 lines) | stat: -rw-r--r-- 1,367 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
37
38
39
40
; RUN: llc %s -o - -enable-shrink-wrap=true | FileCheck %s
; RUN: llc %s -o - -enable-shrink-wrap=false | FileCheck %s
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i686-pc-windows-msvc18.0.0"

%struct.S = type { i32 }

; Check that we do not use a basic block that has EFLAGS as live-in
; if we need to realign the stack.
; PR27531.
; CHECK-LABEL: stackRealignment:
; Prologue code.
; CHECK: pushl
; Make sure we actually perform some stack realignment.
; CHECK: andl ${{[-0-9]+}}, %esp
; This is the end of the entry block.
; The prologue should have happened before that point because past
; this point, EFLAGS is live.
; CHECK: jg
define x86_thiscallcc void @stackRealignment(ptr %this) {
entry:
  %data = alloca [1 x i32], align 4
  %d = alloca double, align 8
  %tmp1 = load i32, ptr %this, align 4
  %cmp = icmp sgt i32 %tmp1, 32
  %cond = select i1 %cmp, i32 42, i32 128
  store i32 %cond, ptr %data, align 4
  %cmp3 = icmp slt i32 %tmp1, 32
  br i1 %cmp3, label %cleanup, label %if.end

if.end:                                           ; preds = %entry
  call x86_thiscallcc void @bar(ptr nonnull %this, ptr %data, ptr nonnull %d)
  br label %cleanup

cleanup:                                          ; preds = %if.end, %entry
  ret void
}

; Function Attrs: optsize
declare x86_thiscallcc void @bar(ptr, ptr, ptr)