2016-07-16 10:24:59 +08:00
|
|
|
# RUN: llc -run-pass none -o - %s | FileCheck %s
|
MIR Serialization: Serialize the simple MachineFrameInfo attributes.
This commit serializes the 13 scalar boolean and integer attributes from the
MachineFrameInfo class: IsFrameAddressTaken, IsReturnAddressTaken, HasStackMap,
HasPatchPoint, StackSize, OffsetAdjustment, MaxAlignment, AdjustsStack,
HasCalls, MaxCallFrameSize, HasOpaqueSPAdjustment, HasVAStart, and
HasMustTailInVarArgFunc. These attributes are serialized as part
of the frameInfo YAML mapping, which itself is a part of the machine function's
YAML mapping.
llvm-svn: 241844
2015-07-10 03:55:27 +08:00
|
|
|
# This test ensures that the MIR parser parses machine frame info properties
|
|
|
|
# correctly.
|
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
|
define i32 @test(i32 %a) {
|
|
|
|
entry:
|
|
|
|
%b = alloca i32
|
|
|
|
store i32 %a, i32* %b
|
|
|
|
%c = load i32, i32* %b
|
|
|
|
ret i32 %c
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @test2(i32 %a) {
|
|
|
|
entry:
|
|
|
|
%b = alloca i32
|
|
|
|
store i32 %a, i32* %b
|
|
|
|
%c = load i32, i32* %b
|
|
|
|
ret i32 %c
|
|
|
|
}
|
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test
|
|
|
|
tracksRegLiveness: true
|
|
|
|
|
|
|
|
# CHECK: frameInfo:
|
|
|
|
# CHECK-NEXT: isFrameAddressTaken: false
|
|
|
|
# CHECK-NEXT: isReturnAddressTaken: false
|
|
|
|
# CHECK-NEXT: hasStackMap: false
|
|
|
|
# CHECK-NEXT: hasPatchPoint: false
|
|
|
|
# CHECK-NEXT: stackSize: 0
|
|
|
|
# CHECK-NEXT: offsetAdjustment: 0
|
|
|
|
# Note: max alignment can be target specific when printed.
|
|
|
|
# CHECK-NEXT: maxAlignment:
|
|
|
|
# CHECK-NEXT: adjustsStack: false
|
|
|
|
# CHECK-NEXT: hasCalls: false
|
2017-06-06 16:16:19 +08:00
|
|
|
# CHECK-NEXT: stackProtector: ''
|
|
|
|
# CHECK-NEXT: maxCallFrameSize:
|
[codeview] Emit S_FRAMEPROC and use S_DEFRANGE_FRAMEPOINTER_REL
Summary:
Before this change, LLVM would always describe locals on the stack as
being relative to some specific register, RSP, ESP, EBP, ESI, etc.
Variables in stack memory are pretty common, so there is a special
S_DEFRANGE_FRAMEPOINTER_REL symbol for them. This change uses it to
reduce the size of our debug info.
On top of the size savings, there are cases on 32-bit x86 where local
variables are addressed from ESP, but ESP changes across the function.
Unlike in DWARF, there is no FPO data to describe the stack adjustments
made to push arguments onto the stack and pop them off after the call,
which makes it hard for the debugger to find the local variables in
frames further up the stack.
To handle this, CodeView has a special VFRAME register, which
corresponds to the $T0 variable set by our FPO data in 32-bit. Offsets
to local variables are instead relative to this value.
This is part of PR38857.
Reviewers: hans, zturner, javed.absar
Subscribers: aprantl, hiraditya, JDevlieghere, llvm-commits
Differential Revision: https://reviews.llvm.org/D52217
llvm-svn: 343543
2018-10-02 05:59:45 +08:00
|
|
|
# CHECK-NEXT: cvBytesOfCalleeSavedRegisters: 0
|
MIR Serialization: Serialize the simple MachineFrameInfo attributes.
This commit serializes the 13 scalar boolean and integer attributes from the
MachineFrameInfo class: IsFrameAddressTaken, IsReturnAddressTaken, HasStackMap,
HasPatchPoint, StackSize, OffsetAdjustment, MaxAlignment, AdjustsStack,
HasCalls, MaxCallFrameSize, HasOpaqueSPAdjustment, HasVAStart, and
HasMustTailInVarArgFunc. These attributes are serialized as part
of the frameInfo YAML mapping, which itself is a part of the machine function's
YAML mapping.
llvm-svn: 241844
2015-07-10 03:55:27 +08:00
|
|
|
# CHECK-NEXT: hasOpaqueSPAdjustment: false
|
|
|
|
# CHECK-NEXT: hasVAStart: false
|
|
|
|
# CHECK-NEXT: hasMustTailInVarArgFunc: false
|
2018-04-06 16:56:25 +08:00
|
|
|
# CHECK-NEXT: localFrameSize: 0
|
2017-06-06 16:16:19 +08:00
|
|
|
# CHECK-NEXT: savePoint: ''
|
|
|
|
# CHECK-NEXT: restorePoint: ''
|
MIR Serialization: Serialize the simple MachineFrameInfo attributes.
This commit serializes the 13 scalar boolean and integer attributes from the
MachineFrameInfo class: IsFrameAddressTaken, IsReturnAddressTaken, HasStackMap,
HasPatchPoint, StackSize, OffsetAdjustment, MaxAlignment, AdjustsStack,
HasCalls, MaxCallFrameSize, HasOpaqueSPAdjustment, HasVAStart, and
HasMustTailInVarArgFunc. These attributes are serialized as part
of the frameInfo YAML mapping, which itself is a part of the machine function's
YAML mapping.
llvm-svn: 241844
2015-07-10 03:55:27 +08:00
|
|
|
# CHECK: body
|
|
|
|
frameInfo:
|
|
|
|
maxAlignment: 4
|
2015-08-14 07:10:16 +08:00
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
MIR Serialization: Serialize the simple MachineFrameInfo attributes.
This commit serializes the 13 scalar boolean and integer attributes from the
MachineFrameInfo class: IsFrameAddressTaken, IsReturnAddressTaken, HasStackMap,
HasPatchPoint, StackSize, OffsetAdjustment, MaxAlignment, AdjustsStack,
HasCalls, MaxCallFrameSize, HasOpaqueSPAdjustment, HasVAStart, and
HasMustTailInVarArgFunc. These attributes are serialized as part
of the frameInfo YAML mapping, which itself is a part of the machine function's
YAML mapping.
llvm-svn: 241844
2015-07-10 03:55:27 +08:00
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test2
|
|
|
|
tracksRegLiveness: true
|
|
|
|
|
|
|
|
# CHECK: test2
|
|
|
|
# CHECK: frameInfo:
|
|
|
|
# CHECK-NEXT: isFrameAddressTaken: true
|
|
|
|
# CHECK-NEXT: isReturnAddressTaken: true
|
|
|
|
# CHECK-NEXT: hasStackMap: true
|
|
|
|
# CHECK-NEXT: hasPatchPoint: true
|
|
|
|
# CHECK-NEXT: stackSize: 4
|
|
|
|
# CHECK-NEXT: offsetAdjustment: 4
|
|
|
|
# Note: max alignment can be target specific when printed.
|
|
|
|
# CHECK-NEXT: maxAlignment:
|
|
|
|
# CHECK-NEXT: adjustsStack: true
|
|
|
|
# CHECK-NEXT: hasCalls: true
|
2017-06-06 16:16:19 +08:00
|
|
|
# CHECK-NEXT: stackProtector: ''
|
MIR Serialization: Serialize the simple MachineFrameInfo attributes.
This commit serializes the 13 scalar boolean and integer attributes from the
MachineFrameInfo class: IsFrameAddressTaken, IsReturnAddressTaken, HasStackMap,
HasPatchPoint, StackSize, OffsetAdjustment, MaxAlignment, AdjustsStack,
HasCalls, MaxCallFrameSize, HasOpaqueSPAdjustment, HasVAStart, and
HasMustTailInVarArgFunc. These attributes are serialized as part
of the frameInfo YAML mapping, which itself is a part of the machine function's
YAML mapping.
llvm-svn: 241844
2015-07-10 03:55:27 +08:00
|
|
|
# CHECK-NEXT: maxCallFrameSize: 4
|
[codeview] Emit S_FRAMEPROC and use S_DEFRANGE_FRAMEPOINTER_REL
Summary:
Before this change, LLVM would always describe locals on the stack as
being relative to some specific register, RSP, ESP, EBP, ESI, etc.
Variables in stack memory are pretty common, so there is a special
S_DEFRANGE_FRAMEPOINTER_REL symbol for them. This change uses it to
reduce the size of our debug info.
On top of the size savings, there are cases on 32-bit x86 where local
variables are addressed from ESP, but ESP changes across the function.
Unlike in DWARF, there is no FPO data to describe the stack adjustments
made to push arguments onto the stack and pop them off after the call,
which makes it hard for the debugger to find the local variables in
frames further up the stack.
To handle this, CodeView has a special VFRAME register, which
corresponds to the $T0 variable set by our FPO data in 32-bit. Offsets
to local variables are instead relative to this value.
This is part of PR38857.
Reviewers: hans, zturner, javed.absar
Subscribers: aprantl, hiraditya, JDevlieghere, llvm-commits
Differential Revision: https://reviews.llvm.org/D52217
llvm-svn: 343543
2018-10-02 05:59:45 +08:00
|
|
|
# CHECK-NEXT: cvBytesOfCalleeSavedRegisters: 8
|
MIR Serialization: Serialize the simple MachineFrameInfo attributes.
This commit serializes the 13 scalar boolean and integer attributes from the
MachineFrameInfo class: IsFrameAddressTaken, IsReturnAddressTaken, HasStackMap,
HasPatchPoint, StackSize, OffsetAdjustment, MaxAlignment, AdjustsStack,
HasCalls, MaxCallFrameSize, HasOpaqueSPAdjustment, HasVAStart, and
HasMustTailInVarArgFunc. These attributes are serialized as part
of the frameInfo YAML mapping, which itself is a part of the machine function's
YAML mapping.
llvm-svn: 241844
2015-07-10 03:55:27 +08:00
|
|
|
# CHECK-NEXT: hasOpaqueSPAdjustment: true
|
|
|
|
# CHECK-NEXT: hasVAStart: true
|
|
|
|
# CHECK-NEXT: hasMustTailInVarArgFunc: true
|
|
|
|
# CHECK: body
|
|
|
|
frameInfo:
|
|
|
|
isFrameAddressTaken: true
|
|
|
|
isReturnAddressTaken: true
|
|
|
|
hasStackMap: true
|
|
|
|
hasPatchPoint: true
|
|
|
|
stackSize: 4
|
|
|
|
offsetAdjustment: 4
|
|
|
|
maxAlignment: 4
|
|
|
|
adjustsStack: true
|
|
|
|
hasCalls: true
|
|
|
|
maxCallFrameSize: 4
|
[codeview] Emit S_FRAMEPROC and use S_DEFRANGE_FRAMEPOINTER_REL
Summary:
Before this change, LLVM would always describe locals on the stack as
being relative to some specific register, RSP, ESP, EBP, ESI, etc.
Variables in stack memory are pretty common, so there is a special
S_DEFRANGE_FRAMEPOINTER_REL symbol for them. This change uses it to
reduce the size of our debug info.
On top of the size savings, there are cases on 32-bit x86 where local
variables are addressed from ESP, but ESP changes across the function.
Unlike in DWARF, there is no FPO data to describe the stack adjustments
made to push arguments onto the stack and pop them off after the call,
which makes it hard for the debugger to find the local variables in
frames further up the stack.
To handle this, CodeView has a special VFRAME register, which
corresponds to the $T0 variable set by our FPO data in 32-bit. Offsets
to local variables are instead relative to this value.
This is part of PR38857.
Reviewers: hans, zturner, javed.absar
Subscribers: aprantl, hiraditya, JDevlieghere, llvm-commits
Differential Revision: https://reviews.llvm.org/D52217
llvm-svn: 343543
2018-10-02 05:59:45 +08:00
|
|
|
cvBytesOfCalleeSavedRegisters: 8
|
MIR Serialization: Serialize the simple MachineFrameInfo attributes.
This commit serializes the 13 scalar boolean and integer attributes from the
MachineFrameInfo class: IsFrameAddressTaken, IsReturnAddressTaken, HasStackMap,
HasPatchPoint, StackSize, OffsetAdjustment, MaxAlignment, AdjustsStack,
HasCalls, MaxCallFrameSize, HasOpaqueSPAdjustment, HasVAStart, and
HasMustTailInVarArgFunc. These attributes are serialized as part
of the frameInfo YAML mapping, which itself is a part of the machine function's
YAML mapping.
llvm-svn: 241844
2015-07-10 03:55:27 +08:00
|
|
|
hasOpaqueSPAdjustment: true
|
|
|
|
hasVAStart: true
|
|
|
|
hasMustTailInVarArgFunc: true
|
2018-04-06 16:56:25 +08:00
|
|
|
localFrameSize: 256
|
2015-08-14 07:10:16 +08:00
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
MIR Serialization: Serialize the simple MachineFrameInfo attributes.
This commit serializes the 13 scalar boolean and integer attributes from the
MachineFrameInfo class: IsFrameAddressTaken, IsReturnAddressTaken, HasStackMap,
HasPatchPoint, StackSize, OffsetAdjustment, MaxAlignment, AdjustsStack,
HasCalls, MaxCallFrameSize, HasOpaqueSPAdjustment, HasVAStart, and
HasMustTailInVarArgFunc. These attributes are serialized as part
of the frameInfo YAML mapping, which itself is a part of the machine function's
YAML mapping.
llvm-svn: 241844
2015-07-10 03:55:27 +08:00
|
|
|
...
|
|
|
|
|