From a3318d17d4ab89753ef26e9b41eb5a0469346a35 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 18 Feb 2008 17:47:29 +0000 Subject: [PATCH] minor code simplification, no functionality change. llvm-svn: 47275 --- lib/Transforms/Scalar/GVN.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index a4f78fe4573..efe8254cd54 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(dep)) + return performReturnSlotOptzn(M, C, toErase); + else if (!isa(dep)) return false; - else if (!isa(dep)) { - if (CallInst* C = dyn_cast(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