LICM - remove unused variable and reduce scope of another variable. NFCI.

Appeases both clang static analyzer and cppcheck

llvm-svn: 373453
This commit is contained in:
Simon Pilgrim 2019-10-02 11:49:53 +00:00
parent 619bcebc05
commit da4cbae696
1 changed files with 2 additions and 4 deletions

View File

@ -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<MemoryUse>(PreheaderLoadMemoryAccess);
MSSAU->insertUse(NewMemUse, /*RenameUses=*/true);