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 | 0af56010288ca9862ec99d781119742065cee705 (patch) | |
tree | eb0adc2dad2b4c70b3ccffef5f934e40ae7ead0f /llvm/lib/Transforms | |
parent | 23fe6630e3a7687248a50d7faea50308d5b2c99b (diff) | |
download | bcm5719-llvm-0af56010288ca9862ec99d781119742065cee705.tar.gz bcm5719-llvm-0af56010288ca9862ec99d781119742065cee705.zip |
minor code simplification, no functionality change.
llvm-svn: 47275
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/GVN.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp index a4f78fe4573..efe8254cd54 100644 --- a/llvm/lib/Transforms/Scalar/GVN.cpp +++ b/llvm/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 |