brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · c6e5aed Raw
59 lines · plain
1## This checks that shrink wrapping correctly drops moving push/pops when2## there is a MOV instruction loading the value of the stack pointer in3## order to do pointer arithmetic with a stack address.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: ld.lld %t.o -o %t.exe -q13# RUN: llvm-bolt %t.exe -relocs -o %t.out -data %t.fdata \14# RUN:     -frame-opt=all -simplify-conditional-tail-calls=false \15# RUN:     -experimental-shrink-wrapping \16# RUN:     -eliminate-unreachable=false | FileCheck %s17 18  .globl _start19  .type _start, %function20_start:21  .cfi_startproc22# FDATA: 0 [unknown] 0 1 _start 0 0 123  push  %rbp24  mov   %rsp, %rbp25  push  %rbx26  push  %r1427  subq  $0x20, %rsp28  je  b29c:30  addq  $0x20, %rsp31  pop %r1432  pop %rbx33  pop %rbp34  ret35b:36  je  f37  jmp *JT(,%rdi,8)38d:39  mov %r14, %rdi40  mov %rbx, %rdi41  mov %rbp, %rdi42  sub 0x20, %rdi43f:44  addq  $0x20, %rsp45  pop %r1446  pop %rbx47  pop %rbp48  ret49  .cfi_endproc50  .size _start, .-_start51  .data52JT:53  .quad c54  .quad d55  .quad f56 57 58# CHECK:   BOLT-INFO: Shrink wrapping moved 2 spills inserting load/stores and 0 spills inserting push/pops59