diff options
author | Chris Lattner <sabre@nondot.org> | 2008-02-18 17:47:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-02-18 17:47:29 +0000 |
commit | 913b19f6fc697c70d456f596d48258a87ebea6be (patch) | |
tree | 9b84d8e52d87b55c5b2d145cfda8a75161a58eeb /lib/Transforms | |
parent | ea0415957d63a139371d6fe971d2d57802760181 (diff) |
minor code simplification, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47275 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/GVN.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index a4f78fe457..efe8254cd5 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -1117,15 +1117,13 @@ bool GVN::processMemCpy(MemCpyInst* M, // First, we have to check that the dependency is another memcpy Instruction* dep = MD.getDependency(M); - if (dep == MemoryDependenceAnalysis::None || - dep == MemoryDependenceAnalysis::NonLocal) + if (dep == MemoryDependenceAnalysis::None || + dep == MemoryDependenceAnalysis::NonLocal) + return false; + else if (CallInst* C = dyn_cast<CallInst>(dep)) + return performReturnSlotOptzn(M, C, toErase); + else if (!isa<MemCpyInst>(dep)) return false; - else if (!isa<MemCpyInst>(dep)) { - if (CallInst* C = dyn_cast<CallInst>(dep)) - return performReturnSlotOptzn(M, C, toErase); - else - return false; - } // We can only transforms memcpy's where the dest of one is the source of the // other |