[Transforms] eliminateDeadStores - remove unused variable. NFC.

The initial MemoryAccess *Current assignment is never used, and all other uses are initialized/used within the worklist loop (and not across multiple iterations) - so move the variable internal to the loop.

Fixes scan-build unused assignment warning.
This commit is contained in:
Simon Pilgrim 2021-10-14 13:35:25 +01:00
parent b6c218d4fd
commit 13185f0154
1 changed files with 1 additions and 3 deletions

View File

@ -1972,8 +1972,6 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA,
MemoryLocation KillingLoc = *MaybeKillingLoc;
assert(KillingLoc.Ptr && "KillingLoc should not be null");
const Value *KillingUndObj = getUnderlyingObject(KillingLoc.Ptr);
MemoryAccess *Current = KillingDef;
LLVM_DEBUG(dbgs() << "Trying to eliminate MemoryDefs killed by "
<< *KillingDef << " (" << *KillingI << ")\n");
@ -1988,7 +1986,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA,
bool IsMemTerm = State.isMemTerminatorInst(KillingI);
// Check if MemoryAccesses in the worklist are killed by KillingDef.
for (unsigned I = 0; I < ToCheck.size(); I++) {
Current = ToCheck[I];
MemoryAccess *Current = ToCheck[I];
if (State.SkipStores.count(Current))
continue;