llvm-project/llvm/lib
Chris Lattner 7aeae25c78 fix a small oversight in the "eliminate memcpy from constant global"
optimization.  If the alloca that is "memcpy'd from constant" also has
a memcpy from *it*, ignore it: it is a load.  We now optimize the testcase to:

define void @test2() {
  %B = alloca %T
  %a = bitcast %T* @G to i8*
  %b = bitcast %T* %B to i8*
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %b, i8* %a, i64 124, i32 4, i1 false)
  call void @bar(i8* %b)
  ret void
}

previously we would generate:

define void @test() {
  %B = alloca %T
  %b = bitcast %T* %B to i8*
  %G.0 = getelementptr inbounds %T* @G, i32 0, i32 0
  %tmp3 = load i8* %G.0, align 4
  %G.1 = getelementptr inbounds %T* @G, i32 0, i32 1
  %G.15 = bitcast [123 x i8]* %G.1 to i8*
  %1 = bitcast [123 x i8]* %G.1 to i984*
  %srcval = load i984* %1, align 1
  %B.0 = getelementptr inbounds %T* %B, i32 0, i32 0
  store i8 %tmp3, i8* %B.0, align 4
  %B.1 = getelementptr inbounds %T* %B, i32 0, i32 1
  %B.12 = bitcast [123 x i8]* %B.1 to i8*
  %2 = bitcast [123 x i8]* %B.1 to i984*
  store i984 %srcval, i984* %2, align 1
  call void @bar(i8* %b)
  ret void
}

llvm-svn: 119682
2010-11-18 06:20:47 +00:00
..
Analysis Introduce memoization for ScalarEvolution dominates and properlyDominates 2010-11-18 00:34:22 +00:00
Archive Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally." 2010-09-13 23:59:48 +00:00
AsmParser Add a new 'hotpatch' attribute. This attribute will insert a two-byte no-op 2010-10-25 15:37:09 +00:00
Bitcode Fix PR8494: when reading invalid bitcode, getTypeByID may return 2010-10-28 15:47:26 +00:00
CodeGen Change CodeGen to use .loc directives. This produces a lot more readable output 2010-11-18 02:04:25 +00:00
CompilerDriver Rename FindExecutable to PrependMainExecutablePath. 2010-11-03 16:14:16 +00:00
ExecutionEngine MCJIT: Stub out MCJIT implementation, still doesn't do anything useful. 2010-11-17 16:06:43 +00:00
Linker GetDLLSuffix: Remove the leading dot from LTDL_SHLIB_EXT. 2010-11-02 20:32:59 +00:00
MC Change CodeGen to use .loc directives. This produces a lot more readable output 2010-11-18 02:04:25 +00:00
Object Fix typo: Exectuable -> Executable 2010-11-17 00:43:43 +00:00
Support now that AsmPrinter::EmitInlineAsm is factored right, we can eliminate the 2010-11-17 08:13:01 +00:00
System Fix typo: Exectuable -> Executable 2010-11-17 00:43:43 +00:00
Target trivial QoI improvement. On this invalid input: 2010-11-18 02:53:02 +00:00
Transforms fix a small oversight in the "eliminate memcpy from constant global" 2010-11-18 06:20:47 +00:00
VMCore Now that hasConstantValue has been made simpler, it may return the 2010-11-17 10:23:23 +00:00
Makefile Add LLVMObject Library. 2010-11-15 03:21:41 +00:00