[llvm] 4a5201f - [NFC][GlobalOpt] Remove unused parameters
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 18 21:23:49 PDT 2022
Author: Arthur Eubanks
Date: 2022-06-18T21:23:39-07:00
New Revision: 4a5201f484d81fcfd823191c8c9da43766ae1e53
URL: https://github.com/llvm/llvm-project/commit/4a5201f484d81fcfd823191c8c9da43766ae1e53
DIFF: https://github.com/llvm/llvm-project/commit/4a5201f484d81fcfd823191c8c9da43766ae1e53.diff
LOG: [NFC][GlobalOpt] Remove unused parameters
Added:
Modified:
llvm/lib/Transforms/IPO/GlobalOpt.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index dc286ea5db47..a2b47166cdfc 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -1038,7 +1038,6 @@ valueIsOnlyUsedLocallyOrStoredToOneGlobal(const CallInst *CI,
/// accessing the data, and exposes the resultant global to further GlobalOpt.
static bool tryToOptimizeStoreOfAllocationToGlobal(GlobalVariable *GV,
CallInst *CI,
- AtomicOrdering Ordering,
const DataLayout &DL,
TargetLibraryInfo *TLI) {
if (!isAllocRemovable(CI, TLI))
@@ -1085,7 +1084,7 @@ static bool tryToOptimizeStoreOfAllocationToGlobal(GlobalVariable *GV,
// its initializer) is ever stored to the global.
static bool
optimizeOnceStoredGlobal(GlobalVariable *GV, Value *StoredOnceVal,
- AtomicOrdering Ordering, const DataLayout &DL,
+ const DataLayout &DL,
function_ref<TargetLibraryInfo &(Function &)> GetTLI) {
// Ignore no-op GEPs and bitcasts.
StoredOnceVal = StoredOnceVal->stripPointerCasts();
@@ -1110,7 +1109,7 @@ optimizeOnceStoredGlobal(GlobalVariable *GV, Value *StoredOnceVal,
} else if (isAllocationFn(StoredOnceVal, GetTLI)) {
if (auto *CI = dyn_cast<CallInst>(StoredOnceVal)) {
auto *TLI = &GetTLI(*CI->getFunction());
- if (tryToOptimizeStoreOfAllocationToGlobal(GV, CI, Ordering, DL, TLI))
+ if (tryToOptimizeStoreOfAllocationToGlobal(GV, CI, DL, TLI))
return true;
}
}
@@ -1595,7 +1594,7 @@ processInternalGlobal(GlobalVariable *GV, const GlobalStatus &GS,
// Try to optimize globals based on the knowledge that only one value
// (besides its initializer) is ever stored to the global.
- if (optimizeOnceStoredGlobal(GV, StoredOnceValue, GS.Ordering, DL, GetTLI))
+ if (optimizeOnceStoredGlobal(GV, StoredOnceValue, DL, GetTLI))
return true;
// Otherwise, if the global was not a boolean, we can shrink it to be a
More information about the llvm-commits
mailing list