http://llvm.org/bugs/show_bug.cgi?id=8925
Summary: Unnecessary munging of stack pointer with guarantee
tail calls
Product: libraries
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: Backend: X86
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
In the following test case:
define fastcc i32* @force.ri32(i32* %x) nounwind {
entry:
%nz = icmp eq i32* %x, null
br i1 %nz, label %Limpl1.pre, label %Limpl0.pre
Limpl0.pre: ; preds = %entry
ret i32* %x
Limpl1.pre: ; preds = %entry
tail call fastcc void @pr.error() noreturn nounwind
unreachable
}
declare fastcc void @pr.error() noreturn nounwind
LLVM currently generates:
_force.ri32: ## @force.ri32
## BB#0: ## %entry
subq $8, %rsp
testq %rdi, %rdi
je LBB0_2
## BB#1: ## %Limpl0.pre
movq %rdi, %rax
addq $8, %rsp
ret $8
LBB0_2: ## %Limpl1.pre
addq $8, %rsp
jmp _pr.error ## TAILCALL
The instructions that change %rsp are unnecessary.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs