61 lines · plain
1## This checks that frame optimizer does not try to optimize away caller-saved2## regs when we do not have complete aliasing info (when there is an LEA3## instruction and the function does arithmetic with stack addresses).4 5 6# REQUIRES: system-linux7 8# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \9# RUN: %s -o %t.o10# RUN: link_fdata %s %t.o %t.fdata11# RUN: llvm-strip --strip-unneeded %t.o12# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib13# RUN: llvm-bolt %t.exe -relocs -o %t.out -data %t.fdata \14# RUN: -frame-opt=all -simplify-conditional-tail-calls=false \15# RUN: -lite=0 -eliminate-unreachable=false | FileCheck %s16# RUN: llvm-objdump -d %t.out --print-imm-hex | \17# RUN: FileCheck --check-prefix CHECK-OBJDUMP %s18 19 .globl foo20 .type foo, %function21foo:22 .cfi_startproc23 movq $0, (%rsi)24 ret25 .cfi_endproc26 .size foo, .-foo27 28 29 .globl _start30 .type _start, %function31_start:32 .cfi_startproc33# FDATA: 0 [unknown] 0 1 _start 0 0 134 push %rbp35 mov %rsp, %rbp36 subq $0x20, %rsp37 je b38c:39 addq $0x20, %rsp40 pop %rbp41 ret42b:43 movq %rdi, %r1344 movq %r13, -0x08(%rbp)45 leaq -0x08(%rbp), %rsi46 callq foo47 movq -0x08(%rbp), %r1348 jmp c49 .cfi_endproc50 .size _start, .-_start51 52 53# CHECK: BOLT-INFO: FOP deleted 0 load(s) (dyn count: 0) and 0 store(s)54 55# CHECK-OBJDUMP: <_start>:56# CHECK-OBJDUMP: movq %rdi, %r1357# CHECK-OBJDUMP-NEXT: movq %r13, -0x8(%rbp)58# CHECK-OBJDUMP-NEXT: leaq59# CHECK-OBJDUMP-NEXT: callq60# CHECK-OBJDUMP-NEXT: movq -0x8(%rbp), %r1361