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-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=45a8ceb940baa669e4c27a94a3d032ba3f5dbc7f;p=llvm LICM - remove unused variable and reduce scope of another variable. NFCI. Appeases both clang static analyzer and cppcheck git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373453 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index f099b4d20c4..5c2176f873b 100644 --- a/lib/Transforms/Scalar/LICM.cpp +++ b/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);