llvm.org GIT mirror llvm / b3f91b0
[Stackmaps] Make ithe frame-pointer required for stackmaps. Do not eliminate the frame pointer if there is a stackmap or patchpoint in the function. All stackmap references should be FP relative. This fixes PR21107. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218920 91177308-0d34-0410-b5e6-96231b3b80d8 Juergen Ributzka 5 years ago
9 changed file(s) with 16 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
9191 #endif
9292
9393 return (MFI->hasCalls() || MFI->hasVarSizedObjects() ||
94 MFI->isFrameAddressTaken());
94 MFI->isFrameAddressTaken() || MFI->hasStackMap() ||
95 MFI->hasPatchPoint());
9596 }
9697
9798 /// hasReservedCallFrame - Under normal circumstances, when a frame pointer is
5252 MFI->hasVarSizedObjects() ||
5353 MFI->isFrameAddressTaken() || MFI->hasInlineAsmWithSPAdjust() ||
5454 MF.getInfo()->getForceFramePointer() ||
55 MMI.callsUnwindInit() || MMI.callsEHReturn());
55 MMI.callsUnwindInit() || MMI.callsEHReturn() ||
56 MFI->hasStackMap() || MFI->hasPatchPoint());
5657 }
5758
5859 static unsigned getSUBriOpcode(unsigned IsLP64, int64_t Imm) {
None ; RUN: llc -mtriple=x86_64-apple-darwin -mcpu=corei7 -disable-fp-elim < %s | FileCheck %s
1 ; RUN: llc -mtriple=x86_64-apple-darwin -mcpu=corei7 -disable-fp-elim -fast-isel -fast-isel-abort < %s | FileCheck %s --check-prefix=FAST
0 ; RUN: llc -mtriple=x86_64-apple-darwin -mcpu=corei7 < %s | FileCheck %s
1 ; RUN: llc -mtriple=x86_64-apple-darwin -mcpu=corei7 -fast-isel -fast-isel-abort < %s | FileCheck %s --check-prefix=FAST
22
33 ; Test the webkit_jscc calling convention.
44 ; One argument will be passed in register, the other will be pushed on the stack.
None ; RUN: llc -mtriple=x86_64-apple-darwin -mcpu=corei7 -disable-fp-elim < %s | FileCheck %s
1 ; RUN: llc -mtriple=x86_64-apple-darwin -mcpu=corei7 -disable-fp-elim -fast-isel -fast-isel-abort < %s | FileCheck %s
0 ; RUN: llc -mtriple=x86_64-apple-darwin -mcpu=corei7 < %s | FileCheck %s
1 ; RUN: llc -mtriple=x86_64-apple-darwin -mcpu=corei7 -fast-isel -fast-isel-abort < %s | FileCheck %s
22
33 ; Trivial patchpoint codegen
44 ;
None ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 -disable-fp-elim | FileCheck %s
1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 -disable-fp-elim -fast-isel -fast-isel-abort | FileCheck %s
0 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 | FileCheck %s
1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 -fast-isel -fast-isel-abort | FileCheck %s
22
33 ; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps
44 ; CHECK-NEXT: __LLVM_StackMaps:
None ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -disable-fp-elim -enable-patchpoint-liveness=false | FileCheck %s
1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -disable-fp-elim | FileCheck -check-prefix=PATCH %s
0 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -enable-patchpoint-liveness=false | FileCheck %s
1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx | FileCheck -check-prefix=PATCH %s
22 ;
33 ; Note: Print verbose stackmaps using -debug-only=stackmaps.
44
None ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 -disable-fp-elim | FileCheck %s
0 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 | FileCheck %s
11
22 define void @nop_test() {
33 entry:
None ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 -disable-fp-elim | FileCheck %s
0 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 | FileCheck %s
11
22 ; Check that the X86 stackmap shadow optimization is only outputting a 1-byte
33 ; nop here. 8-bytes are requested, but 7 are covered by the code for the call to
1717 }
1818
1919 declare void @llvm.experimental.stackmap(i64, i32, ...)
20 declare void @bar()
20 declare void @bar()
None ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 -disable-fp-elim | FileCheck %s
0 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 | FileCheck %s
11 ;
22 ; Note: Print verbose stackmaps using -debug-only=stackmaps.
33