add a note
authorChris Lattner <sabre@nondot.org>
Mon, 20 Aug 2007 02:14:33 +0000 (02:14 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 20 Aug 2007 02:14:33 +0000 (02:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41178 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/README.txt

index 5c75fc96b42c3023f710c0eb6473f66b80a0a6ef..467e0252399265ccb03d74cfac0a097d9b7e6e2b 100644 (file)
@@ -1116,3 +1116,21 @@ _test1:
         addps   %xmm1, %xmm0
         ret
 
+//===---------------------------------------------------------------------===//
+
+Leaf functions that require one 4-byte spill slot have a prolog like this:
+
+_foo:
+        pushl   %esi
+        subl    $4, %esp
+...
+and an epilog like this:
+        addl    $4, %esp
+        popl    %esi
+        ret
+
+It would be smaller, and potentially faster, to push eax on entry and to
+pop into a dummy register instead of using addl/subl of esp.  Just don't pop 
+into any return registers :)
+
+//===---------------------------------------------------------------------===//