https://llvm.org/bugs/show_bug.cgi?id=26333
Bug ID: 26333 Summary: [x86] Use pop to restore stack instead of add Product: libraries Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: Backend: X86 Assignee: unassignedb...@nondot.org Reporter: h...@chromium.org CC: llvm-bugs@lists.llvm.org Blocks: 26299 Classification: Unclassified Consider the following at -Os: struct S { void foo(); }; S *bar(int); void baz() { bar(0)->foo(); } Clang will generate: 00000000 <?baz@@YAXXZ>: 0: 6a 00 push $0x0 2: e8 00 00 00 00 call 7 <?baz@@YAXXZ+0x7> 7: 83 c4 04 add $0x4,%esp a: 89 c1 mov %eax,%ecx c: e9 00 00 00 00 jmp 11 <@feat.00+0x10> Instead of 'add $0x4,%esp', MSVC would do 'pop %ecx' and save two bytes, because %ecx isn't live there anyway. This incurs a memory access, but since nothing depends on the result, maybe that would be OK, at least at -Os? -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs