http://llvm.org/bugs/show_bug.cgi?id=11787
Bug #: 11787
Summary: Unneeded copy when passing by value
Product: libraries
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
The following code:
typedef struct {
struct { double x; double y; double z; double w; } a;
struct { double x; double y; double z; double w; } b;
struct { double x; double y; double z; double w; } c;
struct { double x; double y; double z; double w; } d;
} matrix;
matrix make_matrix();
void set_matrix(matrix);
void p()
{
matrix k = make_matrix();
set_matrix(k);
}
generates this:
_p: ## @p
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $264, %rsp ## imm = 0x108
leaq -136(%rbp), %rbx
movq %rbx, %rdi
xorb %al, %al
callq _make_matrix
movl $16, %ecx
movq %rsp, %rdi
movq %rbx, %rsi
rep;movsq
callq _set_matrix
addq $264, %rsp ## imm = 0x108
popq %rbx
popq %rbp
ret
It would be nice if we could avoid the copy of the matrix
--
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