[llvm] 5c41b0f - [Analysis] Remove getUniqueInstruction (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 13 14:26:25 PDT 2022
Author: Kazu Hirata
Date: 2022-06-13T14:26:20-07:00
New Revision: 5c41b0f429652ef50b9378e890f17a1426958e17
URL: https://github.com/llvm/llvm-project/commit/5c41b0f429652ef50b9378e890f17a1426958e17
DIFF: https://github.com/llvm/llvm-project/commit/5c41b0f429652ef50b9378e890f17a1426958e17.diff
LOG: [Analysis] Remove getUniqueInstruction (NFC)
The last use was removed on Apr 7, 2022 in commit
5cefe7d9f531fe6eac4cd22978861752498b2265.
Added:
Modified:
llvm/include/llvm/Analysis/AliasSetTracker.h
llvm/lib/Analysis/AliasSetTracker.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/AliasSetTracker.h b/llvm/include/llvm/Analysis/AliasSetTracker.h
index f3c3b5aac9eeb..78f5545ab215a 100644
--- a/llvm/include/llvm/Analysis/AliasSetTracker.h
+++ b/llvm/include/llvm/Analysis/AliasSetTracker.h
@@ -221,10 +221,6 @@ class AliasSet : public ilist_node<AliasSet> {
// track of the list's exact size.
unsigned size() { return SetSize; }
- /// If this alias set is known to contain a single instruction and *only* a
- /// single unique instruction, return it. Otherwise, return nullptr.
- Instruction* getUniqueInstruction();
-
void print(raw_ostream &OS) const;
void dump() const;
diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp
index ade2933d85260..7f40a875da4b0 100644
--- a/llvm/lib/Analysis/AliasSetTracker.cpp
+++ b/llvm/lib/Analysis/AliasSetTracker.cpp
@@ -254,31 +254,6 @@ bool AliasSet::aliasesUnknownInst(const Instruction *Inst,
return false;
}
-Instruction* AliasSet::getUniqueInstruction() {
- if (AliasAny)
- // May have collapses alias set
- return nullptr;
- if (begin() != end()) {
- if (!UnknownInsts.empty())
- // Another instruction found
- return nullptr;
- if (std::next(begin()) != end())
- // Another instruction found
- return nullptr;
- Value *Addr = begin()->getValue();
- assert(!Addr->user_empty() &&
- "where's the instruction which added this pointer?");
- if (std::next(Addr->user_begin()) != Addr->user_end())
- // Another instruction found -- this is really restrictive
- // TODO: generalize!
- return nullptr;
- return cast<Instruction>(*(Addr->user_begin()));
- }
- if (1 != UnknownInsts.size())
- return nullptr;
- return cast<Instruction>(UnknownInsts[0]);
-}
-
void AliasSetTracker::clear() {
// Delete all the PointerRec entries.
for (auto &I : PointerMap)
More information about the llvm-commits
mailing list