Displaying 2 results from an estimated 2 matches for "palpar".
2018 Sep 14
2
Function calls keep increasing the stack usage
...gt; movl %eax, -4(%rbp) # 4-byte Spill
> callq foo
> movl %eax, -8(%rbp) # 4-byte Spill
> addq $16, %rsp
> popq %rbp
> .cfi_def_cfa %rsp, 8
> retq
>
>
> On Fri, Sep 14, 2018 at 8:16 AM palpar via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> Hi everyone,
>>
>> I found that LLVM generates redundant code when calling functions with
>> constant parameters, with optimizations disabled.
>>
>> Consider the following C code snippet:
>&g...
2018 Sep 14
6
Function calls keep increasing the stack usage
Hi everyone,
I found that LLVM generates redundant code when calling functions with
constant parameters, with optimizations disabled.
Consider the following C code snippet:
int foo(int x, int y);
void bar()
{
foo(1, 2);
foo(3, 4);
}
Clang/LLVM 6.0 generates the following assembly code:
_bar:
subl $32, %esp
movl $1, %eax
movl $2, %ecx
movl $1, (%esp)
movl $2, 4(%esp)
movl %eax, 28(%esp)
movl