aboutsummaryrefslogtreecommitdiff
path: root/llvm
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-09-09 01:07:01 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-09-09 01:07:01 +0000
commit2c3ea554985b1433db28a504c629d5d8c0eea185 (patch)
tree825906161d9fcbd50a26e0725ba04bea0d0ec125 /llvm
parentceff02280004b71a139cdbf0e9de788889cc0bd3 (diff)
downloadllvm-2c3ea554985b1433db28a504c629d5d8c0eea185.zip
llvm-2c3ea554985b1433db28a504c629d5d8c0eea185.tar.gz
llvm-2c3ea554985b1433db28a504c629d5d8c0eea185.tar.bz2
[X86] Tighten up a comment which confused x64 ABI terminology.
The x64 ABI has two major function types: - frame functions - leaf functions A frame function is one which requires a stack frame. A leaf function is one which does not. A frame function may or may not have a frame pointer. A leaf function does not require a stack frame and may never modify SP except via a return (RET, tail call via JMP). A frame function which has a frame pointer is permitted to use the LEA instruction in the epilogue, a frame function without which doesn't establish a frame pointer must use ADD to adjust the stack pointer epilogue. Fun fact: Leaf functions don't require a function table entry (associated PDATA/XDATA). llvm-svn: 281006
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/X86/X86FrameLowering.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86FrameLowering.cpp b/llvm/lib/Target/X86/X86FrameLowering.cpp
index 9f5a0c6..3941995 100644
--- a/llvm/lib/Target/X86/X86FrameLowering.cpp
+++ b/llvm/lib/Target/X86/X86FrameLowering.cpp
@@ -1400,9 +1400,9 @@ void X86FrameLowering::emitPrologue(MachineFunction &MF,
bool X86FrameLowering::canUseLEAForSPInEpilogue(
const MachineFunction &MF) const {
- // We can't use LEA instructions for adjusting the stack pointer if this is a
- // leaf function in the Win64 ABI. Only ADD instructions may be used to
- // deallocate the stack.
+ // We can't use LEA instructions for adjusting the stack pointer if we don't
+ // have a frame pointer in the Win64 ABI. Only ADD instructions may be used
+ // to deallocate the stack.
// This means that we can use LEA for SP in two situations:
// 1. We *aren't* using the Win64 ABI which means we are free to use LEA.
// 2. We *have* a frame pointer which means we are permitted to use LEA.