llvm-6502/lib
Duncan P. N. Exon Smith 3fdfffbfa3 GVN: Enable value forwarding for calloc
Enable value forwarding for loads from `calloc()` without an intervening
store.

This change extends GVN to handle the following case:

    %1 = tail call noalias i8* @calloc(i64 1, i64 4)
    %2 = bitcast i8* %1 to i32*
    ; This load is trivially constant zero
    %3 = load i32* %2, align 4

This is analogous to the handling for `malloc()` in the same places.
`malloc()` returns `undef`; `calloc()` returns a zero value.  Note that
it is correct to return zero even for out of bounds GEPs since the
result of such a GEP would be undefined.

Patch by Philip Reames!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210828 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-12 21:16:19 +00:00
..
Analysis Removing an "if (!this)" check from two print methods. The condition will 2014-06-09 22:53:16 +00:00
AsmParser Remove system_error.h. 2014-06-12 17:38:55 +00:00
Bitcode Remove system_error.h. 2014-06-12 17:38:55 +00:00
CodeGen Revert "SelectionDAG: Enable (and (setcc x), (setcc y)) -> (setcc (and x, y)) for vectors" 2014-06-12 16:04:47 +00:00
DebugInfo [llvm-symbolizer] Fix parsing DW_AT_ranges in Fission skeleton compile unit DIEs. 2014-06-12 18:52:35 +00:00
ExecutionEngine Remove system_error.h. 2014-06-12 17:38:55 +00:00
IR Remove system_error.h. 2014-06-12 17:38:55 +00:00
IRReader Remove system_error.h. 2014-06-12 17:38:55 +00:00
LineEditor
Linker Allow aliases to be unnamed_addr. 2014-06-06 01:20:28 +00:00
LTO Remove system_error.h. 2014-06-12 17:38:55 +00:00
MC MC: add enumeration of WinEH data encoding 2014-06-11 04:19:25 +00:00
Object Remove system_error.h. 2014-06-12 17:38:55 +00:00
Option Options: Use erase_if to remove Args from the list. 2014-05-18 15:14:13 +00:00
ProfileData Don't import error_category into the llvm namespace. 2014-06-12 01:45:43 +00:00
Support Trying to fix the windows build. 2014-06-12 17:49:35 +00:00
TableGen Remove system_error.h. 2014-06-12 17:38:55 +00:00
Target R600: Mostly remove remaining AMDIL intrinsics. 2014-06-12 21:15:44 +00:00
Transforms GVN: Enable value forwarding for calloc 2014-06-12 21:16:19 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile