https://bugs.llvm.org/show_bug.cgi?id=38862

            Bug ID: 38862
           Summary: Optimize pass struct by value to tail call
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedb...@nondot.org
          Reporter: david.bolvan...@gmail.com
                CC: llvm-bugs@lists.llvm.org

struct A {
    int x[64];
};

void structByValue(A s);

void callStructByValue(A s) {
  structByValue(s);
}

Clang:
callStructByValue(A): # @callStructByValue(A)
  sub rsp, 264
  lea rsi, [rsp + 272]
  mov ecx, 32
  mov rdi, rsp
  rep movsq
  call structByValue(A)
  add rsp, 264
  ret

GCC:
callStructByValue(A):
  jmp     structByValue(A)



If I change code to:
struct A {
    int *x;
};

Clang tail calls it too.

-- 
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

Reply via email to