[llvm] 47a4773 - [GlobalStatus] Remove unused HasNonInstructionUser member (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 12 00:41:19 PST 2022
Author: Nikita Popov
Date: 2022-01-12T09:40:54+01:00
New Revision: 47a47733f01f3e230c1aa6ab8844f86d67dc8e17
URL: https://github.com/llvm/llvm-project/commit/47a47733f01f3e230c1aa6ab8844f86d67dc8e17
DIFF: https://github.com/llvm/llvm-project/commit/47a47733f01f3e230c1aa6ab8844f86d67dc8e17.diff
LOG: [GlobalStatus] Remove unused HasNonInstructionUser member (NFC)
This hasn't been used in a long time.
Added:
Modified:
llvm/include/llvm/Transforms/Utils/GlobalStatus.h
llvm/lib/Transforms/Utils/GlobalStatus.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Transforms/Utils/GlobalStatus.h b/llvm/include/llvm/Transforms/Utils/GlobalStatus.h
index 78d7845c4353..775dd23d8f23 100644
--- a/llvm/include/llvm/Transforms/Utils/GlobalStatus.h
+++ b/llvm/include/llvm/Transforms/Utils/GlobalStatus.h
@@ -73,10 +73,6 @@ struct GlobalStatus {
const Function *AccessingFunction = nullptr;
bool HasMultipleAccessingFunctions = false;
- /// Set to true if this global has a user that is not an instruction (e.g. a
- /// constant expr or GV initializer).
- bool HasNonInstructionUser = false;
-
/// Set to the strongest atomic ordering requirement.
AtomicOrdering Ordering = AtomicOrdering::NotAtomic;
diff --git a/llvm/lib/Transforms/Utils/GlobalStatus.cpp b/llvm/lib/Transforms/Utils/GlobalStatus.cpp
index 440ac63b7b69..f8ec8c6ad426 100644
--- a/llvm/lib/Transforms/Utils/GlobalStatus.cpp
+++ b/llvm/lib/Transforms/Utils/GlobalStatus.cpp
@@ -66,8 +66,6 @@ static bool analyzeGlobalAux(const Value *V, GlobalStatus &GS,
for (const Use &U : V->uses()) {
const User *UR = U.getUser();
if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(UR)) {
- GS.HasNonInstructionUser = true;
-
// If the result of the constantexpr isn't pointer type, then we won't
// know to expect it in various places. Just reject early.
if (!isa<PointerType>(CE->getType()))
@@ -172,12 +170,10 @@ static bool analyzeGlobalAux(const Value *V, GlobalStatus &GS,
return true; // Any other non-load instruction might take address!
}
} else if (const Constant *C = dyn_cast<Constant>(UR)) {
- GS.HasNonInstructionUser = true;
// We might have a dead and dangling constant hanging off of here.
if (!isSafeToDestroyConstant(C))
return true;
} else {
- GS.HasNonInstructionUser = true;
// Otherwise must be some other user.
return true;
}
More information about the llvm-commits
mailing list