From 1d10a1d5b1ff8fc9ce923b6ea92f049c73a669ab Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 10 Jan 2021 09:24:54 -0800 Subject: [PATCH] [MemorySSA] Remove unused dominatesUse (NFC) The function was introduced without a use on Feb 2, 2016 in commit e1100f533f0a48f55e80e1152b06f5deab5f9b30. --- llvm/include/llvm/Analysis/MemorySSA.h | 1 - llvm/lib/Analysis/MemorySSA.cpp | 17 ----------------- 2 files changed, 18 deletions(-) diff --git a/llvm/include/llvm/Analysis/MemorySSA.h b/llvm/include/llvm/Analysis/MemorySSA.h index 5dfae50..63c031b 100644 --- a/llvm/include/llvm/Analysis/MemorySSA.h +++ b/llvm/include/llvm/Analysis/MemorySSA.h @@ -850,7 +850,6 @@ private: using DefsMap = DenseMap>; void markUnreachableAsLiveOnEntry(BasicBlock *BB); - bool dominatesUse(const MemoryAccess *, const MemoryAccess *) const; MemoryPhi *createMemoryPhi(BasicBlock *BB); template MemoryUseOrDef *createNewAccess(Instruction *, AliasAnalysisType *, diff --git a/llvm/lib/Analysis/MemorySSA.cpp b/llvm/lib/Analysis/MemorySSA.cpp index e728a5f..f0d27e0 100644 --- a/llvm/lib/Analysis/MemorySSA.cpp +++ b/llvm/lib/Analysis/MemorySSA.cpp @@ -1817,23 +1817,6 @@ MemoryUseOrDef *MemorySSA::createNewAccess(Instruction *I, return MUD; } -/// Returns true if \p Replacer dominates \p Replacee . -bool MemorySSA::dominatesUse(const MemoryAccess *Replacer, - const MemoryAccess *Replacee) const { - if (isa(Replacee)) - return DT->dominates(Replacer->getBlock(), Replacee->getBlock()); - const auto *MP = cast(Replacee); - // For a phi node, the use occurs in the predecessor block of the phi node. - // Since we may occur multiple times in the phi node, we have to check each - // operand to ensure Replacer dominates each operand where Replacee occurs. - for (const Use &Arg : MP->operands()) { - if (Arg.get() != Replacee && - !DT->dominates(Replacer->getBlock(), MP->getIncomingBlock(Arg))) - return false; - } - return true; -} - /// Properly remove \p MA from all of MemorySSA's lookup tables. void MemorySSA::removeFromLookups(MemoryAccess *MA) { assert(MA->use_empty() && -- 2.7.4