summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/MemCpyOpt
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* sabre brings to my attention that the 'tr' suffix is also obsoleteGabor Greif2008-05-201-1/+1
| | | | llvm-svn: 51349
* Rename the last test with .llx extension to .ll, resolve duplicate test by ↵Gabor Greif2008-05-201-1/+1
| | | | | | renaming to isnan2. Now that no test has llx ending there is no need to search for them from dg.exp too. llvm-svn: 51328
* Fix a bug in memcpyopt where the memcpy-memcpy transform was never being ↵Owen Anderson2008-04-291-0/+17
| | | | | | | | | applied because we were checking for it in the wrong order. This caused a miscompilation because the return slot optimization assumes that the call it is dealing with is NOT a memcpy. llvm-svn: 50444
* Refactor memcpyopt based on Chris' suggestions. Consolidate several functionsOwen Anderson2008-04-212-4/+4
| | | | | | and simplify code that was fallout from the separation of memcpyopt and gvn. llvm-svn: 50034
* Factor a bunch of functionality related to memcpy and memset transforms out of Owen Anderson2008-04-097-0/+260
GVN and into its own pass. llvm-svn: 49419
OpenPOWER on IntegriCloud