diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-02-12 21:20:26 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-02-12 21:20:26 +0000 |
| commit | 44e9472fc628c808c6a4e81232ca205123c148e2 (patch) | |
| tree | 8dd42d87b8d9917bd593ba39aa83e59835e40f54 | |
| parent | b5c89c8d2d5f25fd0a53950e516b109565d643a9 (diff) | |
| download | bcm5719-llvm-44e9472fc628c808c6a4e81232ca205123c148e2.tar.gz bcm5719-llvm-44e9472fc628c808c6a4e81232ca205123c148e2.zip | |
more notes
llvm-svn: 34204
| -rw-r--r-- | llvm/lib/Target/X86/README.txt | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/README.txt b/llvm/lib/Target/X86/README.txt index 2f8cb7e918a..554c49beba1 100644 --- a/llvm/lib/Target/X86/README.txt +++ b/llvm/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. //===---------------------------------------------------------------------===// |

