llvm/lib
Chris Lattner b3f0673d52 Teach valuetracking that byval arguments with a specified alignment are
aligned.

Teach memcpyopt to not give up all hope when confonted with an underaligned
memcpy feeding an overaligned byval.  If the *source* of the memcpy can be
determined to be adequeately aligned, or if it can be forced to be, we can
eliminate the memcpy.

This addresses PR9794.  We now compile the example into:

define i32 @f(%struct.p* nocapture byval align 8 %q) nounwind ssp {
entry:
  %call = call i32 @g(%struct.p* byval align 8 %q) nounwind
  ret i32 %call
}

in both x86-64 and x86-32 mode.  We still don't get a tailcall though,
because tailcalls apparently can't handle byval.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131884 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 00:03:39 +00:00
..
Analysis Teach valuetracking that byval arguments with a specified alignment are 2011-05-23 00:03:39 +00:00
Archive Revert PathV2 changes, as sys::fs::unique_file is not finished yet. 2011-03-01 19:50:55 +00:00
AsmParser Remove unused variables caught by GCC's -Wunused-but-set-variable. 2011-05-03 16:00:27 +00:00
Bitcode It's valid to take the blockaddress of a different function, so remove this 2011-05-06 21:09:44 +00:00
CodeGen Eliminate some temporary variables, and don't call getByValTypeAlignment 2011-05-22 23:23:02 +00:00
CompilerDriver Build CompilerDriver library. 2011-03-12 22:01:42 +00:00
ExecutionEngine Avoid a Twine that referenced a tmp (which proceded to go out of scope before 2011-05-19 00:45:05 +00:00
Linker Set the unnamed_addr only when we're creating a new GV in the dest module. 2011-03-29 23:31:06 +00:00
MC Add methods to parse the SEH directives to the COFFAsmParser. Implement some 2011-05-22 21:12:15 +00:00
Object Remove dead variable pointed out by GCC 4.6 warnings, and reflow this a little 2011-05-02 05:05:29 +00:00
Support fix a bug for hosts without round, PR8893. 2011-05-22 06:03:53 +00:00
Target add a missing alias to make us more bug compatible with gcc, PR9378 2011-05-22 22:31:57 +00:00
Transforms Teach valuetracking that byval arguments with a specified alignment are 2011-05-23 00:03:39 +00:00
VMCore add a helper method to get the byval alignment of an argument. 2011-05-22 23:57:23 +00:00
CMakeLists.txt Build CompilerDriver library. 2011-03-12 22:01:42 +00:00
Makefile Add LLVMObject Library. 2010-11-15 03:21:41 +00:00