[llvm] eda2bca - [nfc][amdgpu] Remove dead variable and function
Jon Chesterfield via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 15 15:57:04 PDT 2022
Author: Jon Chesterfield
Date: 2022-07-15T23:56:43+01:00
New Revision: eda2bcad020d882d487cac2951d2ad9b75f59123
URL: https://github.com/llvm/llvm-project/commit/eda2bcad020d882d487cac2951d2ad9b75f59123
DIFF: https://github.com/llvm/llvm-project/commit/eda2bcad020d882d487cac2951d2ad9b75f59123.diff
LOG: [nfc][amdgpu] Remove dead variable and function
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp b/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
index 35922341de26..ffdb6c576398 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
@@ -55,21 +55,6 @@ static cl::opt<bool> SuperAlignLDSGlobals(
cl::init(true), cl::Hidden);
namespace {
-
-SmallPtrSet<GlobalValue *, 32> getUsedList(Module &M) {
- SmallPtrSet<GlobalValue *, 32> UsedList;
-
- SmallVector<GlobalValue *, 32> TmpVec;
- collectUsedGlobalVariables(M, TmpVec, true);
- UsedList.insert(TmpVec.begin(), TmpVec.end());
-
- TmpVec.clear();
- collectUsedGlobalVariables(M, TmpVec, false);
- UsedList.insert(TmpVec.begin(), TmpVec.end());
-
- return UsedList;
-}
-
class AMDGPULowerModuleLDS : public ModulePass {
static void removeFromUsedList(Module &M, StringRef Name,
@@ -153,9 +138,6 @@ class AMDGPULowerModuleLDS : public ModulePass {
"");
}
-private:
- SmallPtrSet<GlobalValue *, 32> UsedList;
-
public:
static char ID;
@@ -165,7 +147,6 @@ class AMDGPULowerModuleLDS : public ModulePass {
bool runOnModule(Module &M) override {
CallGraph CG = CallGraph(M);
- UsedList = getUsedList(M);
bool Changed = superAlignLDSGlobals(M);
Changed |= processUsedLDS(CG, M);
@@ -179,7 +160,6 @@ class AMDGPULowerModuleLDS : public ModulePass {
Changed |= processUsedLDS(CG, M, &F);
}
- UsedList.clear();
return Changed;
}
@@ -352,7 +332,6 @@ class AMDGPULowerModuleLDS : public ModulePass {
GV->replaceAllUsesWith(GEP);
}
if (GV->use_empty()) {
- UsedList.erase(GV);
GV->eraseFromParent();
}
More information about the llvm-commits
mailing list