summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/ScalarRepl/memcpy-from-global.ll
Commit message (Collapse)AuthorAgeFilesLines
* Port the global copy optimization from the SROA pass to InstCombine.Chandler Carruth2012-08-211-146/+0
| | | | | | | | | | This optimization is really just replacing allocas wholesale with globals, there is no scalarization. The underlying motivation for this patch is to simplify the SROA pass and focus it on splitting and promoting allocas. llvm-svn: 162271
* Do not eliminate allocas whose alignment exceeds that of thePeter Collingbourne2012-05-191-0/+36
| | | | | | | copied-in constant, as a subsequent user may rely on over alignment. Fixes PR12885. llvm-svn: 157134
* Teach one piece of scalarrepl to handle lifetime markers. When transforming anNick Lewycky2011-06-271-0/+14
| | | | | | | | alloca that only holds a copy of a global and we're going to replace the users of the alloca with that global, just nuke the lifetime intrinsics. Part of PR10121. llvm-svn: 133905
* allow eliminating an alloca that is just copied from an constant globalChris Lattner2010-11-181-0/+13
| | | | | | | | if it is passed as a byval argument. The byval argument will just be a read, so it is safe to read from the original global instead. This allows us to promote away the %agg.tmp alloca in PR8582 llvm-svn: 119686
* enhance the "alloca is just a memcpy from constant global"Chris Lattner2010-11-181-0/+13
| | | | | | | to ignore calls that obviously can't modify the alloca because they are readonly/readnone. llvm-svn: 119683
* fix a small oversight in the "eliminate memcpy from constant global"Chris Lattner2010-11-181-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* filecheckizeChris Lattner2010-11-181-2/+9
| | | | llvm-svn: 119681
* Make opt default to not adding a target data string and update tests that ↵Kenneth Uildriks2009-11-031-0/+1
| | | | | | depend on target data to supply it within the test llvm-svn: 85900
* Change tests from "opt %s" to "opt < %s" so that opt doesn't see theDan Gohman2009-09-111-1/+1
| | | | | | | | input filename so that opt doesn't print the input filename in the output so that grep lines in the tests don't unintentionally match strings in the input filename. llvm-svn: 81537
* Use opt -S instead of piping bitcode output through llvm-dis.Dan Gohman2009-09-081-1/+1
| | | | llvm-svn: 81257
* Change these tests to feed the assembly files to opt directly, insteadDan Gohman2009-09-081-1/+1
| | | | | | of using llvm-as, now that opt supports this. llvm-svn: 81226
* Split the Add, Sub, and Mul instruction opcodes into separateDan Gohman2009-06-041-8/+8
| | | | | | | | | | | | | | | integer and floating-point opcodes, introducing FAdd, FSub, and FMul. For now, the AsmParser, BitcodeReader, and IRBuilder all preserve backwards compatability, and the Core LLVM APIs preserve backwards compatibility for IR producers. Most front-ends won't need to change immediately. This implements the first step of the plan outlined here: http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt llvm-svn: 72897
* new testcase, should be able to eliminate the alloca and memcpyChris Lattner2007-04-251-0/+33
llvm-svn: 36428
OpenPOWER on IntegriCloud