summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* eliminate the "Value" printing methods that print to a std::ostream.Chris Lattner2009-08-231-3/+4
| | | | | | This required converting a bunch of stuff off DOUT and other cleanups. llvm-svn: 79819
* Make TargetData optional in MemCpyOptimizer.Dan Gohman2009-08-181-10/+10
| | | | llvm-svn: 79306
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-9/+11
| | | | llvm-svn: 78948
* Move types back to the 2.5 API.Owen Anderson2009-07-291-2/+1
| | | | llvm-svn: 77516
* Move ConstantExpr to 2.5 API.Owen Anderson2009-07-291-2/+2
| | | | llvm-svn: 77494
* Grab the LLVMContext and parent Module of SI ahead of theDan Gohman2009-07-281-3/+4
| | | | | | | point where SI can get deleted. This fixes a use of free'd memory. This fixes Externals/Povray. llvm-svn: 77285
* Remove Value::getName{Start,End}, the last of the old Name APIs.Daniel Dunbar2009-07-261-1/+1
| | | | llvm-svn: 77152
* Revert the ConstantInt constructors back to their 2.5 forms where possible, ↵Owen Anderson2009-07-241-3/+3
| | | | | | thanks to contexts-on-types. More to come. llvm-svn: 77011
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-9/+12
| | | | llvm-svn: 76702
* Even more passes being LLVMContext'd.Owen Anderson2009-07-031-9/+10
| | | | llvm-svn: 74781
* Rename PaddedSize to AllocSize, in the hope that thisDuncan Sands2009-05-091-4/+4
| | | | | | | will make it more obvious what it represents, and stop it being confused with the StoreSize. llvm-svn: 71349
* Remove strange extra semicolons.Nick Lewycky2009-03-191-1/+1
| | | | llvm-svn: 67287
* change the MemIntrinsic get/setAlignment method to take an unsignedChris Lattner2009-03-081-6/+4
| | | | | | instead of a Constant*, which is what the clients of it really want. llvm-svn: 66364
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-121-4/+4
| | | | | | suggested by Chris. llvm-svn: 62099
* Make a few major changes to memdep and its clients:Chris Lattner2008-12-051-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Merge the 'None' result into 'Normal', making loads and stores return their dependencies on allocations as Normal. 2. Split the 'Normal' result into 'Clobber' and 'Def' to distinguish between the cases when memdep knows the value is produced from when we just know if may be changed. 3. Move some of the logic for determining whether readonly calls are CSEs into memdep instead of it being in GVN. This still leaves verification that the arguments are hte same to GVN to let it know about value equivalences in different contexts. 4. Change memdep's call/call dependency analysis to use getModRefInfo(CallSite,CallSite) instead of doing something very weak. This only really matters for things like DSA, but someday maybe we'll have some other decent context sensitive analyses :) 5. This reimplements the guts of memdep to handle the new results. 6. This simplifies GVN significantly: a) readonly call CSE is slightly simpler b) I eliminated the "getDependencyFrom" chaining for load elimination and load CSE doesn't have to worry about volatile (they are always clobbers) anymore. c) GVN no longer does any 'lastLoad' caching, leaving it to memdep. 7. The logic in DSE is simplified a bit and sped up. A potentially unsafe case was eliminated. llvm-svn: 60607
* Eliminate the dropInstruction method, which is not needed any more.Chris Lattner2008-11-291-5/+2
| | | | | | Fix a subtle iterator invalidation bug I introduced in the last commit. llvm-svn: 60258
* Introduce and use a new MemDepResult class to hold the results of a memdepChris Lattner2008-11-291-6/+5
| | | | | | | | | | | query. This makes it crystal clear what cases can escape from MemDep that the clients have to handle. This also gives the clients a nice simplified interface to it that is easy to poke at. This patch also makes DepResultTy and MemoryDependenceAnalysis::DepType private, yay. llvm-svn: 60231
* Reimplement the internal abstraction used by MemDep in termsChris Lattner2008-11-291-7/+7
| | | | | | | | | | | | | | | of a pointer/int pair instead of a manually bitmangled pointer. This forces clients to think a little more about checking the appropriate pieces and will be useful for internal implementation improvements later. I'm not particularly happy with this. After going through this I don't think that the clients of memdep should be exposed to the internal type at all. I'll fix this in a subsequent commit. This has no functionality change. llvm-svn: 60230
* reapply Sanjiv's patch to genericize memcpy/memset/memmove to take anChris Lattner2008-11-211-3/+8
| | | | | | arbitrary integer width for the count. llvm-svn: 59823
* Revert r59802. It was breaking the build of llvm-gcc:Bill Wendling2008-11-211-8/+3
| | | | | | | | | | | | | | | | | | | | | g++ -m32 -c -g -DIN_GCC -W -Wall -Wwrite-strings -Wmissing-format-attribute -fno-common -mdynamic-no-pic -DHAVE_CONFIG_H -Wno-unused -DTARGET_NAME=\"i386-apple-darwin9.5.0\" -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DENABLE_LLVM -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/../llvm.src/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include ../../llvm-gcc.src/gcc/llvm-types.cpp -o llvm-types.o ../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemCpy(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)': ../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i32' is not a member of 'llvm::Intrinsic' ../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i64' is not a member of 'llvm::Intrinsic' ../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemMove(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)': ../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i32' is not a member of 'llvm::Intrinsic' ../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i64' is not a member of 'llvm::Intrinsic' ../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemSet(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)': ../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i32' is not a member of 'llvm::Intrinsic' ../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i64' is not a member of 'llvm::Intrinsic' make[3]: *** [llvm-convert.o] Error 1 make[3]: *** Waiting for unfinished jobs.... rm fsf-funding.pod gcov.pod gfdl.pod cpp.pod gpl.pod gcc.pod make[2]: *** [all-stage1-gcc] Error 2 make[1]: *** [stage1-bubble] Error 2 make: *** [all] Error 2 llvm-svn: 59809
* Make mem[cpy,move,set] intrinsics overloaded.Sanjiv Gupta2008-11-211-3/+8
| | | | llvm-svn: 59802
* s/ParameterAttributes/Attributes/gDevang Patel2008-09-231-1/+0
| | | | llvm-svn: 56513
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | llvm-svn: 55779
* Fix two issues that Eli Friedman pointed out, where would misoptimized code ↵Owen Anderson2008-06-011-3/+14
| | | | | | | | | | | | | | | | 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
* Don't remove the memcpy when call slot substitution fails.Owen Anderson2008-06-011-0/+5
| | | | llvm-svn: 51848
* API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. ↵Gabor Greif2008-05-161-1/+1
| | | | | | Legacy interfaces will be in place for some time. (Merge from use-diet branch.) llvm-svn: 51200
* processStore may delete the instruction, avoidTorok Edwin2008-05-041-2/+1
| | | | | | using dyn_cast<> on already freed memory. llvm-svn: 50618
* Revert r50441. The original code was correct. Add some more comments so ↵Owen Anderson2008-04-291-3/+9
| | | | | | that I don't make the same mistake in the future. llvm-svn: 50446
* Fix a bug in memcpyopt where the memcpy-memcpy transform was never being ↵Owen Anderson2008-04-291-4/+6
| | | | | | | | | 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
* We should be returning true here since we've changed the function.Owen Anderson2008-04-291-1/+1
| | | | llvm-svn: 50442
* Refactor memcpyopt based on Chris' suggestions. Consolidate several functionsOwen Anderson2008-04-211-92/+44
| | | | | | 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-091-0/+769
GVN and into its own pass. llvm-svn: 49419
OpenPOWER on IntegriCloud