Skip to content

Commit

Permalink
[nfc][amdgpu] Remove dead variable and function
Browse files Browse the repository at this point in the history
  • Loading branch information
JonChesterfield committed Jul 15, 2022
1 parent 6b02c53 commit eda2bca
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
Expand Up @@ -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,
Expand Down Expand Up @@ -153,9 +138,6 @@ class AMDGPULowerModuleLDS : public ModulePass {
"");
}

private:
SmallPtrSet<GlobalValue *, 32> UsedList;

public:
static char ID;

Expand All @@ -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);

Expand All @@ -179,7 +160,6 @@ class AMDGPULowerModuleLDS : public ModulePass {
Changed |= processUsedLDS(CG, M, &F);
}

UsedList.clear();
return Changed;
}

Expand Down Expand Up @@ -352,7 +332,6 @@ class AMDGPULowerModuleLDS : public ModulePass {
GV->replaceAllUsesWith(GEP);
}
if (GV->use_empty()) {
UsedList.erase(GV);
GV->eraseFromParent();
}

Expand Down

0 comments on commit eda2bca

Please sign in to comment.