From 385f380e806a10549d91466e7ca22121c866d287 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 15 Sep 2021 11:41:41 -0700 Subject: [PATCH] [MemorySSA] Fix "set but not used" warnings --- llvm/lib/Analysis/MemorySSA.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Analysis/MemorySSA.cpp b/llvm/lib/Analysis/MemorySSA.cpp index b97cd0c6b186..e005e2835ce5 100644 --- a/llvm/lib/Analysis/MemorySSA.cpp +++ b/llvm/lib/Analysis/MemorySSA.cpp @@ -1934,6 +1934,8 @@ void MemorySSA::verifyPrevDefInPhis(Function &F) const { auto *LastAcc = &*(--DefList->end()); assert(LastAcc == IncAcc && "Incorrect incoming access into phi."); + (void)IncAcc; + (void)LastAcc; break; } DTNode = DTNode->getIDom(); @@ -1979,6 +1981,7 @@ void MemorySSA::verifyDominationNumbers(const Function &F) const { unsigned long ThisNumber = ThisNumberIter->second; assert(ThisNumber > LastNumber && "Domination numbers should be strictly increasing!"); + (void)LastNumber; LastNumber = ThisNumber; } } @@ -2009,8 +2012,10 @@ void MemorySSA::verifyOrderingDominationAndDefUses(Function &F, ActualAccesses.push_back(Phi); ActualDefs.push_back(Phi); // Verify domination - for (const Use &U : Phi->uses()) + for (const Use &U : Phi->uses()) { assert(dominates(Phi, U) && "Memory PHI does not dominate it's uses"); + (void)U; + } // Verify def-uses for full verify. if (VL == VerificationLevel::Full) { assert(Phi->getNumOperands() == static_cast(std::distance( @@ -2037,9 +2042,11 @@ void MemorySSA::verifyOrderingDominationAndDefUses(Function &F, // Verify ordering. ActualDefs.push_back(MA); // Verify domination. - for (const Use &U : MD->uses()) + for (const Use &U : MD->uses()) { assert(dominates(MD, U) && "Memory Def does not dominate it's uses"); + (void)U; + } } // Verify def-uses for full verify. if (VL == VerificationLevel::Full)