[LLVMdev] Reserved call frame
Chris Stavrakakis
stavr.chris at gmail.com
Fri Sep 9 04:20:25 PDT 2011
Hello,
i am trying to disable reserved call frame from the x86 backend, by
setting hasReservedCallFrame function, in
lib/Target/X86/X86RegisterInfo.cpp to always return false. When doing
this i get the correct frame size,
and the sub/add rsp instructions around the call correctly, but it seems
that the offsets from rsp are not
correctly updated between the sub instruction and the call.
Is this some kind of a bug, or i should make more changes to disable
reserved call frame ?
Here is a piece of the output of the testcase with the reservedCallFrame
enabled:
# BB#26: # %L51
movq 536(%rsp), %rbp
movq $-5, 536(%rsp)
movq 552(%rsp), %rsi
movq 560(%rsp), %rdx
movq 544(%rsp), %rcx
movq %rdi, (%rsp)
movq $2, 8(%rsp)
sarq $4, %rbp
leaq *128*(%rsp), %rdi
movq %rbp, %r8
movq *40*(%rsp), %r9 # 8-byte Reload
callq bs_put_big_integer # a function call with 5 arguments
movq 128(%rsp), %rax
movq 136(%rsp), %rcx
cmpq $0, 144(%rsp)
movq %rcx, 560(%rsp)
movq %rax, 552(%rsp)
jne .LBB0_30
And the same piece of code with reservedCallFrame disabled:
# BB#26: # %L51
movq 520(%rsp), %rbp
movq $-5, 520(%rsp)
movq 536(%rsp), %rsi
movq 544(%rsp), %rdx
movq 528(%rsp), %rcx
subq *$16*, %rsp
movq %rdi, (%rsp)
movq $2, 8(%rsp)
sarq $4, %rbp
leaq *112*(%rsp), %rdi
movq %rbp, %r8
movq *24*(%rsp), %r9 # 8-byte Reload
callq bs_put_big_integer # a function call with 5 arguments
addq $*16*, %rsp
movq 112(%rsp), %rax
movq 120(%rsp), %rcx
cmpq $0, 128(%rsp)
movq %rcx, 544(%rsp)
movq %rax, 536(%rsp)
jne .LBB0_30
Thanks
Chris Stavrakakis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110909/125afa85/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gen2_3-no_reserved_cf.s
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110909/125afa85/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gen2_3-vanilla.s
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110909/125afa85/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gen2_3.ll
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110909/125afa85/attachment-0002.ksh>
More information about the llvm-dev
mailing list