summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/MemCpyOptimizer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-12-05 21:04:20 +0000
committerChris Lattner <sabre@nondot.org>2008-12-05 21:04:20 +0000
commitb51deb929ca95ce62e622b0475a05d83f26ab04d (patch)
tree5adaab4de52bb7d1a14f4e964469971604a1ffd4 /lib/Transforms/Scalar/MemCpyOptimizer.cpp
parent56d9b6dff34c7f934786aa996d94c9f5d7b0c0c9 (diff)
downloadllvm-b51deb929ca95ce62e622b0475a05d83f26ab04d.tar.gz
llvm-b51deb929ca95ce62e622b0475a05d83f26ab04d.tar.bz2
llvm-b51deb929ca95ce62e622b0475a05d83f26ab04d.tar.xz
Make a few major changes to memdep and its clients:
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60607 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/MemCpyOptimizer.cpp')
-rw-r--r--lib/Transforms/Scalar/MemCpyOptimizer.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/lib/Transforms/Scalar/MemCpyOptimizer.cpp
index 5d68388a99..5e9c5ea3d8 100644
--- a/lib/Transforms/Scalar/MemCpyOptimizer.cpp
+++ b/lib/Transforms/Scalar/MemCpyOptimizer.cpp
@@ -630,13 +630,12 @@ bool MemCpyOpt::processMemCpy(MemCpyInst* M) {
// a) memcpy-memcpy xform which exposes redundance for DSE
// b) call-memcpy xform for return slot optimization
MemDepResult dep = MD.getDependency(M);
- if (!dep.isNormal())
+ if (!dep.isClobber())
return false;
- else if (!isa<MemCpyInst>(dep.getInst())) {
+ if (!isa<MemCpyInst>(dep.getInst())) {
if (CallInst* C = dyn_cast<CallInst>(dep.getInst()))
return performCallSlotOptzn(M, C);
- else
- return false;
+ return false;
}
MemCpyInst* MDep = cast<MemCpyInst>(dep.getInst());