[llvm-bugs] [Bug 25776] New: llvm missing opportunities to overlap non-interfering local variables
llvm-bugs at lists.llvm.org
Tue Dec 8 09:16:50 PST 2015
Bug ID: 25776
Summary: llvm missing opportunities to overlap non-interfering
Component: new bugs
Assignee: unassignedbugs at nondot.org
Reporter: thanm at google.com
CC: llvm-bugs at lists.llvm.org
Created attachment 15416
When I compile the attached testcase "stack-ifthen.cc" with "clang++ -g -O"
using LLVM trunk (linux x86-64), I observe that the size of the stack frame is
larger than it needs to be (~1024 bytes).
Compiling with "g++-4.8 -g -O" yields a stack frame size of ~512 bytes; gcc is
able to recognize that the two local arrays can share the same stack space.
Clang/llvm creates a separate stack allocation for each array, resulting in a
larger stack frame size.
Interestingly, gcc/g++ appears to overlap the two arrays even when compiling
with -O0, which leads me to assume the layout is being done in the front end as
opposed to in the back end.
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs