From: Simon Pilgrim Date: Wed, 2 Oct 2019 11:49:53 +0000 (+0000) Subject: LICM - remove unused variable and reduce scope of another variable. NFCI. X-Git-Tag: llvmorg-11-init~7774 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da4cbae6961a563d45f53e60cde504d90df26da0;p=platform%2Fupstream%2Fllvm.git LICM - remove unused variable and reduce scope of another variable. NFCI. Appeases both clang static analyzer and cppcheck llvm-svn: 373453 --- diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index f099b4d..5c2176f 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -1383,8 +1383,7 @@ static Instruction *CloneInstructionInExitBlock( if (!I.getName().empty()) New->setName(I.getName() + ".le"); - MemoryAccess *OldMemAcc; - if (MSSAU && (OldMemAcc = MSSAU->getMemorySSA()->getMemoryAccess(&I))) { + if (MSSAU && MSSAU->getMemorySSA()->getMemoryAccess(&I)) { // Create a new MemoryAccess and let MemorySSA set its defining access. MemoryAccess *NewMemAcc = MSSAU->createMemoryAccessInBB( New, nullptr, New->getParent(), MemorySSA::Beginning); @@ -2115,9 +2114,8 @@ bool llvm::promoteLoopAccessesToScalars( PreheaderLoad->setAAMetadata(AATags); SSA.AddAvailableValue(Preheader, PreheaderLoad); - MemoryAccess *PreheaderLoadMemoryAccess; if (MSSAU) { - PreheaderLoadMemoryAccess = MSSAU->createMemoryAccessInBB( + MemoryAccess *PreheaderLoadMemoryAccess = MSSAU->createMemoryAccessInBB( PreheaderLoad, nullptr, PreheaderLoad->getParent(), MemorySSA::End); MemoryUse *NewMemUse = cast(PreheaderLoadMemoryAccess); MSSAU->insertUse(NewMemUse, /*RenameUses=*/true);