summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-03-21 21:16:39 +0000
committerDale Johannesen <dalej@apple.com>2007-03-21 21:16:39 +0000
commita827d031548bf69a2c6de7901c0b92ee2fb010a4 (patch)
tree74bf1c18ed2cc435b39f48fc6bda835f6c6602dd /llvm
parenta7f81f29ce44b5d0693c94e3987834acb21b9c81 (diff)
downloadbcm5719-llvm-a827d031548bf69a2c6de7901c0b92ee2fb010a4.tar.gz
bcm5719-llvm-a827d031548bf69a2c6de7901c0b92ee2fb010a4.zip
add generation of unnecessary push/pop around calls
llvm-svn: 35241
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/X86/README.txt42
1 files changed, 42 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/README.txt b/llvm/lib/Target/X86/README.txt
index 758133c0445..72965d0759c 100644
--- a/llvm/lib/Target/X86/README.txt
+++ b/llvm/lib/Target/X86/README.txt
@@ -989,3 +989,45 @@ _foo:
ret
//===---------------------------------------------------------------------===//
+
+We use push/pop of stack space around calls in situations where we don't have to.
+Call to f below produces:
+ subl $16, %esp <<<<<
+ movl %eax, (%esp)
+ call L_f$stub
+ addl $16, %esp <<<<<
+The stack push/pop can be moved into the prolog/epilog. It does this because it's
+building the frame pointer, but this should not be sufficient, only the use of alloca
+should cause it to do this.
+(There are other issues shown by this code, but this is one.)
+
+typedef struct _range_t {
+ float fbias;
+ float fscale;
+ int ibias;
+ int iscale;
+ int ishift;
+ unsigned char lut[];
+} range_t;
+
+struct _decode_t {
+ int type:4;
+ int unit:4;
+ int alpha:8;
+ int N:8;
+ int bpc:8;
+ int bpp:16;
+ int skip:8;
+ int swap:8;
+ const range_t*const*range;
+};
+
+typedef struct _decode_t decode_t;
+
+extern int f(const decode_t* decode);
+
+int decode_byte (const decode_t* decode) {
+ if (decode->swap != 0)
+ return f(decode);
+ return 0;
+}
OpenPOWER on IntegriCloud