Skip to content

Commit 1cae21d

Browse files
authored
AMDGPU: Remove legacy PM version of AMDGPUPromoteAllocaToVector (#144986)
This is only run in the middle end with the new pass manager now, so garbage collect the old PM version.
1 parent cbb5e24 commit 1cae21d

File tree

3 files changed

+0
-45
lines changed

3 files changed

+0
-45
lines changed

llvm/lib/Target/AMDGPU/AMDGPU.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,6 @@ FunctionPass *createAMDGPUPromoteAlloca();
242242
void initializeAMDGPUPromoteAllocaPass(PassRegistry&);
243243
extern char &AMDGPUPromoteAllocaID;
244244

245-
FunctionPass *createAMDGPUPromoteAllocaToVector();
246-
void initializeAMDGPUPromoteAllocaToVectorPass(PassRegistry&);
247-
extern char &AMDGPUPromoteAllocaToVectorID;
248-
249245
struct AMDGPUPromoteAllocaPass : PassInfoMixin<AMDGPUPromoteAllocaPass> {
250246
AMDGPUPromoteAllocaPass(TargetMachine &TM) : TM(TM) {}
251247
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);

llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -167,34 +167,6 @@ class AMDGPUPromoteAlloca : public FunctionPass {
167167
}
168168
};
169169

170-
class AMDGPUPromoteAllocaToVector : public FunctionPass {
171-
public:
172-
static char ID;
173-
174-
AMDGPUPromoteAllocaToVector() : FunctionPass(ID) {}
175-
176-
bool runOnFunction(Function &F) override {
177-
if (skipFunction(F))
178-
return false;
179-
if (auto *TPC = getAnalysisIfAvailable<TargetPassConfig>())
180-
return AMDGPUPromoteAllocaImpl(
181-
TPC->getTM<TargetMachine>(),
182-
getAnalysis<LoopInfoWrapperPass>().getLoopInfo())
183-
.run(F, /*PromoteToLDS*/ false);
184-
return false;
185-
}
186-
187-
StringRef getPassName() const override {
188-
return "AMDGPU Promote Alloca to vector";
189-
}
190-
191-
void getAnalysisUsage(AnalysisUsage &AU) const override {
192-
AU.setPreservesCFG();
193-
AU.addRequired<LoopInfoWrapperPass>();
194-
FunctionPass::getAnalysisUsage(AU);
195-
}
196-
};
197-
198170
static unsigned getMaxVGPRs(unsigned LDSBytes, const TargetMachine &TM,
199171
const Function &F) {
200172
if (!TM.getTargetTriple().isAMDGCN())
@@ -216,7 +188,6 @@ static unsigned getMaxVGPRs(unsigned LDSBytes, const TargetMachine &TM,
216188
} // end anonymous namespace
217189

218190
char AMDGPUPromoteAlloca::ID = 0;
219-
char AMDGPUPromoteAllocaToVector::ID = 0;
220191

221192
INITIALIZE_PASS_BEGIN(AMDGPUPromoteAlloca, DEBUG_TYPE,
222193
"AMDGPU promote alloca to vector or LDS", false, false)
@@ -227,14 +198,7 @@ INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass)
227198
INITIALIZE_PASS_END(AMDGPUPromoteAlloca, DEBUG_TYPE,
228199
"AMDGPU promote alloca to vector or LDS", false, false)
229200

230-
INITIALIZE_PASS_BEGIN(AMDGPUPromoteAllocaToVector, DEBUG_TYPE "-to-vector",
231-
"AMDGPU promote alloca to vector", false, false)
232-
INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass)
233-
INITIALIZE_PASS_END(AMDGPUPromoteAllocaToVector, DEBUG_TYPE "-to-vector",
234-
"AMDGPU promote alloca to vector", false, false)
235-
236201
char &llvm::AMDGPUPromoteAllocaID = AMDGPUPromoteAlloca::ID;
237-
char &llvm::AMDGPUPromoteAllocaToVectorID = AMDGPUPromoteAllocaToVector::ID;
238202

239203
PreservedAnalyses AMDGPUPromoteAllocaPass::run(Function &F,
240204
FunctionAnalysisManager &AM) {
@@ -264,10 +228,6 @@ FunctionPass *llvm::createAMDGPUPromoteAlloca() {
264228
return new AMDGPUPromoteAlloca();
265229
}
266230

267-
FunctionPass *llvm::createAMDGPUPromoteAllocaToVector() {
268-
return new AMDGPUPromoteAllocaToVector();
269-
}
270-
271231
static void collectAllocaUses(AllocaInst &Alloca,
272232
SmallVectorImpl<Use *> &Uses) {
273233
SmallVector<Instruction *, 4> WorkList({&Alloca});

llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,6 @@ extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTarget() {
529529
initializeAMDGPUPreLegalizerCombinerPass(*PR);
530530
initializeAMDGPURegBankCombinerPass(*PR);
531531
initializeAMDGPUPromoteAllocaPass(*PR);
532-
initializeAMDGPUPromoteAllocaToVectorPass(*PR);
533532
initializeAMDGPUCodeGenPreparePass(*PR);
534533
initializeAMDGPULateCodeGenPrepareLegacyPass(*PR);
535534
initializeAMDGPURemoveIncompatibleFunctionsLegacyPass(*PR);

0 commit comments

Comments
 (0)