aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/README.txt
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-12 21:20:26 +0000
committerChris Lattner <sabre@nondot.org>2007-02-12 21:20:26 +0000
commit48d3c108b6c78a90070d068cae02ca9d7b08485f (patch)
treee356e967b8ae3a5777e9e4c143284f41bbc88fc9 /lib/Target/X86/README.txt
parent08ba1de2d2d1a4a6a22e41f851fa1b88cef325cd (diff)
downloadexternal_llvm-48d3c108b6c78a90070d068cae02ca9d7b08485f.zip
external_llvm-48d3c108b6c78a90070d068cae02ca9d7b08485f.tar.gz
external_llvm-48d3c108b6c78a90070d068cae02ca9d7b08485f.tar.bz2
more notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34204 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/README.txt')
-rw-r--r--lib/Target/X86/README.txt29
1 files changed, 26 insertions, 3 deletions
diff --git a/lib/Target/X86/README.txt b/lib/Target/X86/README.txt
index 2f8cb7e..554c49b 100644
--- a/lib/Target/X86/README.txt
+++ b/lib/Target/X86/README.txt
@@ -874,15 +874,15 @@ void test(int X) {
if (X) abort();
}
-is currently compiled to (with -static):
+is currently compiled to:
_test:
subl $12, %esp
cmpl $0, 16(%esp)
- jne LBB1_1 #cond_true
+ jne LBB1_1
addl $12, %esp
ret
-LBB1_1: #cond_true
+LBB1_1:
call L_abort$stub
It would be better to produce:
@@ -895,5 +895,28 @@ _test:
ret
This can be applied to any no-return function call that takes no arguments etc.
+Alternatively, the stack save/restore logic could be shrink-wrapped, producing
+something like this:
+
+_test:
+ cmpl $0, 4(%esp)
+ jne LBB1_1
+ ret
+LBB1_1:
+ subl $12, %esp
+ call L_abort$stub
+
+Both are useful in different situations. Finally, it could be shrink-wrapped
+and tail called, like this:
+
+_test:
+ cmpl $0, 4(%esp)
+ jne LBB1_1
+ ret
+LBB1_1:
+ pop %eax # realign stack.
+ call L_abort$stub
+
+Though this probably isn't worth it.
//===---------------------------------------------------------------------===//