Changes in directory llvm/lib/Target/X86:
README.txt updated: 1.155 -> 1.156 --- Log message: more notes --- Diffs of the changes: (+26 -3) README.txt | 29 ++++++++++++++++++++++++++--- 1 files changed, 26 insertions(+), 3 deletions(-) Index: llvm/lib/Target/X86/README.txt diff -u llvm/lib/Target/X86/README.txt:1.155 llvm/lib/Target/X86/README.txt:1.156 --- llvm/lib/Target/X86/README.txt:1.155 Mon Feb 12 14:26:34 2007 +++ llvm/lib/Target/X86/README.txt Mon Feb 12 15:20:26 2007 @@ -874,15 +874,15 @@ 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 @@ 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. //===---------------------------------------------------------------------===// _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits