summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/MemCpyOpt
Commit message (Collapse)AuthorAgeFilesLines
* Fix the remaining TCL-style quotes found in the testsuite. This isChandler Carruth2012-07-023-3/+3
| | | | | | | | | | | | | | | | | another mechanical change accomplished though the power of terrible Perl scripts. I have manually switched some "s to 's to make escaping simpler. While I started this to fix tests that aren't run in all configurations, the massive number of tests is due to a really frustrating fragility of our testing infrastructure: things like 'grep -v', 'not grep', and 'expected failures' can mask broken tests all too easily. Essentially, I'm deeply disturbed that I can change the testsuite so radically without causing any change in results for most platforms. =/ llvm-svn: 159547
* Move the capture analysis from MemoryDependencyAnalysis to a more general placeChad Rosier2012-05-141-0/+22
| | | | | | | | | so that it can be reused in MemCpyOptimizer. This analysis is needed to remove an unnecessary memcpy when returning a struct into a local variable. rdar://11341081 PR12686 llvm-svn: 156776
* Replace all instances of dg.exp file with lit.local.cfg, since all tests are ↵Eli Bendersky2012-02-162-3/+1
| | | | | | | | run with LIT now and now Dejagnu. dg.exp is no longer needed. Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches. llvm-svn: 150664
* Probably not a good idea to convert a single vector load into a memcpy. WeChad Rosier2011-12-061-0/+12
| | | | | | | | don't do this now, but add a test case to prevent this from happening in the future. Additional test for rdar://9892684 llvm-svn: 145879
* Make the MemCpyOptimizer a bit more aggressive. I can't think of a scenerioChad Rosier2011-12-051-1/+17
| | | | | | | | where this would be bad as the backend shouldn't have a problem inlining small memcpys. rdar://10510150 llvm-svn: 145865
* Oops! Fix test I forgot to submit as part of r142735.Nick Lewycky2011-10-221-2/+2
| | | | llvm-svn: 142736
* Oops! Fix testcase.Nick Lewycky2011-10-161-2/+2
| | | | llvm-svn: 142151
* When looking for dependencies on the src pointer, scan the src pointer. ScanningNick Lewycky2011-10-161-1/+19
| | | | | | on the memcpy call will pull up other unrelated stuff. Fixes PR11142. llvm-svn: 142150
* Atomic load/store handling for the passes using memdep (GVN, DSE, memcpyopt).Eli Friedman2011-08-171-0/+41
| | | | llvm-svn: 137888
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch brings numerous advantages to LLVM. One way to look at it is through diffstat: 109 files changed, 3005 insertions(+), 5906 deletions(-) Removing almost 3K lines of code is a good thing. Other advantages include: 1. Value::getType() is a simple load that can be CSE'd, not a mutating union-find operation. 2. Types a uniqued and never move once created, defining away PATypeHolder. 3. Structs can be "named" now, and their name is part of the identity that uniques them. This means that the compiler doesn't merge them structurally which makes the IR much less confusing. 4. Now that there is no way to get a cycle in a type graph without a named struct type, "upreferences" go away. 5. Type refinement is completely gone, which should make LTO much MUCH faster in some common cases with C++ code. 6. Types are now generally immutable, so we can use "Type *" instead "const Type *" everywhere. Downsides of this patch are that it removes some functions from the C API, so people using those will have to upgrade to (not yet added) new API. "LLVM 3.0" is the right time to do this. There are still some cleanups pending after this, this patch is large enough as-is. llvm-svn: 134829
* rip out a ton of intrinsic modernization logic from AutoUpgrade.cpp, which isChris Lattner2011-06-185-85/+93
| | | | | | | | | for pre-2.9 bitcode files. We keep x86 unaligned loads, movnt, crc32, and the target indep prefetch change. As usual, updating the testsuite is a PITA. llvm-svn: 133337
* make the asmparser reject function and type redefinitions. 'Merging' hasn't ↵Chris Lattner2011-06-171-1/+0
| | | | | | | | been needed since llvm-gcc 3.4 days. llvm-svn: 133248
* manually upgrade a bunch of tests to modern syntax, and remove some thatChris Lattner2011-06-171-1/+4
| | | | | | are either unreduced or only test old syntax. llvm-svn: 133228
* PR10067: Add missing safety check to call return transformation in ↵Eli Friedman2011-06-021-0/+36
| | | | | | MemCpyOpt::processStore. If something accesses the dest of the "copy" between the call and the copy, the performCallSlotOptzn transformation is not valid. llvm-svn: 132485
* Teach valuetracking that byval arguments with a specified alignment areChris Lattner2011-05-231-0/+20
| | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 131884
* Actually check memcpy lengths, instead of just commenting aboutDan Gohman2011-01-211-0/+28
| | | | | | how they should be checked. llvm-svn: 123999
* revert 123144, reenabling the rest of memset formation.Chris Lattner2011-01-121-4/+3
| | | | llvm-svn: 123302
* revert r123146 which disabled code that wasn't the root causeChris Lattner2011-01-121-6/+4
| | | | | | of the bootstrap miscompare issue. llvm-svn: 123299
* fix typoChris Lattner2011-01-101-1/+1
| | | | llvm-svn: 123148
* another (more) aggressive attempt to bring llvm-gcc-i386-linux-selfhostChris Lattner2011-01-101-4/+6
| | | | | | back to life. llvm-svn: 123146
* temporarily disable memset formation from memsets in an effort to restore ↵Chris Lattner2011-01-091-3/+4
| | | | | | buildbot stability. llvm-svn: 123144
* Merge memsets followed by neighboring memsets and other stores intoChris Lattner2011-01-081-0/+28
| | | | | | | | | | | | | | | | larger memsets. Among other things, this fixes rdar://8760394 and allows us to handle "Example 2" from http://blog.regehr.org/archives/320, compiling it into a single 4096-byte memset: _mad_synth_mute: ## @mad_synth_mute ## BB#0: ## %entry pushq %rax movl $4096, %esi ## imm = 0x1000 callq ___bzero popq %rax ret llvm-svn: 123089
* fix an issue in IsPointerOffset that prevented us from recognizing thatChris Lattner2011-01-081-0/+12
| | | | | | P and P+1 are relative to the same base pointer. llvm-svn: 123087
* enhance memcpyopt to merge a store and a subsequentChris Lattner2011-01-081-0/+18
| | | | | | memset into a single larger memset. llvm-svn: 123086
* merge two tests and filecheckifyChris Lattner2011-01-082-103/+113
| | | | llvm-svn: 123082
* start using irbuilder to make mem intrinsics in a few passes.Chris Lattner2010-12-261-1/+1
| | | | llvm-svn: 122572
* MemCpyOpt: Turn memcpys from a constant into a memset if possible.Benjamin Kramer2010-12-241-0/+19
| | | | | | | | | | | | | This allows us to compile "int cst[] = {-1, -1, -1};" into movl $-1, 16(%rsp) movq $-1, 8(%rsp) instead of movl _cst+8(%rip), %eax movl %eax, 16(%rsp) movq _cst(%rip), %rax movq %rax, 8(%rsp) llvm-svn: 122548
* enhance memcpyopt to zap memcpy's that have the same src/dst.Chris Lattner2010-12-091-0/+9
| | | | llvm-svn: 121362
* fix PR8753, eliminating a case where we'd infinitely make a Chris Lattner2010-12-091-3/+16
| | | | | | | substitution because it doesn't actually change the IR. Patch by Jakub Staszak! llvm-svn: 121361
* fix a bozo bug I introduced in r119930, causing a miscompile ofChris Lattner2010-12-011-0/+23
| | | | | | | 20040709-1.c from the gcc testsuite. I was using the size of a pointer instead of the pointee. This fixes rdar://8713376 llvm-svn: 120519
* Implement PR8644: forwarding a memcpy value to a byval,Chris Lattner2010-11-212-2/+17
| | | | | | | | | | | | allowing the memcpy to be eliminated. Unfortunately, the requirements on byval's without explicit alignment are really weak and impossible to predict in the mid-level optimizer, so this doesn't kick in much with current frontends. The fix is to change clang to set alignment on all byval arguments. llvm-svn: 119916
* remove a pointless restriction from memcpyopt. It wasChris Lattner2010-11-182-19/+35
| | | | | | | | | | | | refusing to optimize two memcpy's like this: copy A <- B copy C <- A if it couldn't prove that noalias(B,C). We can eliminate the copy by producing a memmove instead of memcpy. llvm-svn: 119694
* filecheckize, this is still not optimal, see PR8643Chris Lattner2010-11-181-1/+10
| | | | llvm-svn: 119693
* Make BasicAliasAnalysis a normal AliasAnalysis implementation whichDan Gohman2010-10-186-6/+6
| | | | | | | | | | | | does normal initialization and normal chaining. Change the default AliasAnalysis implementation to NoAlias. Update StandardCompileOpts.h and friends to explicitly request BasicAliasAnalysis. Update tests to explicitly request -basicaa. llvm-svn: 116720
* Generalize MemCpyOpt's handling of call slot forwarding to function properly ↵Owen Anderson2010-10-151-0/+25
| | | | | | | | when the call slot forwarding is implemented with a load/store pair rather than a memcpy. llvm-svn: 116637
* Reapply address space patch after fixing an issue in MemCopyOptimizer.Mon P Wang2010-04-041-1/+1
| | | | | | | Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset, e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) llvm-svn: 100304
* Revert r100191 since it breaks objc in clang Mon P Wang2010-04-021-1/+1
| | | | llvm-svn: 100199
* Reapply address space patch after fixing an issue in MemCopyOptimizer.Mon P Wang2010-04-021-1/+1
| | | | | | | Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset, e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) llvm-svn: 100191
* Revert Mon Ping's change 99928, since it broke all the llvm-gcc buildbots.Bob Wilson2010-03-301-1/+1
| | | | llvm-svn: 99948
* Added support for address spaces and added a isVolatile field to memcpy, ↵Mon P Wang2010-03-301-1/+1
| | | | | | | | | memmove, and memset, e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) A update of langref will occur in a subsequent checkin. llvm-svn: 99928
* Make opt default to not adding a target data string and update tests that ↵Kenneth Uildriks2009-11-032-0/+2
| | | | | | depend on target data to supply it within the test llvm-svn: 85900
* When extending a memset range past the front, set the alignment of theDan Gohman2009-09-141-0/+18
| | | | | | memset region to the alignment of the new start address. llvm-svn: 81810
* Change tests from "opt %s" to "opt < %s" so that opt doesn't see theDan Gohman2009-09-119-11/+11
| | | | | | | | 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-088-10/+10
| | | | llvm-svn: 81257
* Change these tests to feed the assembly files to opt directly, insteadDan Gohman2009-09-088-10/+10
| | | | | | of using llvm-as, now that opt supports this. llvm-svn: 81226
* Fix PR4882, by making MemCpyOpt not dereference removed stores to get theChris Lattner2009-09-081-0/+45
| | | | | | | | context for the newly created operations. Patch by Jakub Staszak! llvm-svn: 81175
* enhance memcpy opt to turn memmoves into memcpy when the src/destChris Lattner2009-09-012-107/+37
| | | | | | | don't alias. Remove an old and poorly reduced testcase that fails with this transform for reasons unrelated to the original test. llvm-svn: 80693
* Split the Add, Sub, and Mul instruction opcodes into separateDan Gohman2009-06-042-2/+2
| | | | | | | | | | | | | | | 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
* Fix two issues that Eli Friedman pointed out, where would misoptimized code ↵Owen Anderson2008-06-011-1/+1
| | | | | | | | | | | | | | | | like: char a[200]; init(a, a+200); OR int a[200]; char* b = (char*)a; char* c = (char*)a; foo(b, c); llvm-svn: 51850
* Test for PR2401Owen Anderson2008-06-011-0/+107
| | | | llvm-svn: 51849
OpenPOWER on IntegriCloud