Skip to content

Commit 672cc8b

Browse files
authored
[GlobalISel] Allow customizing instruction-select pass
- Allow customizing instruction-select pass to add additional analysis dependencies. Reviewers: aemerson, arsenm, aeubanks Reviewed By: arsenm Pull Request: #95724
1 parent 72d8c27 commit 672cc8b

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

llvm/include/llvm/CodeGen/GlobalISel/InstructionSelect.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class InstructionSelect : public MachineFunctionPass {
4949
MachineFunctionProperties::Property::Selected);
5050
}
5151

52-
InstructionSelect(CodeGenOptLevel OL);
53-
InstructionSelect();
52+
InstructionSelect(CodeGenOptLevel OL = CodeGenOptLevel::Default,
53+
char &PassID = ID);
5454

5555
bool runOnMachineFunction(MachineFunction &MF) override;
5656

llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,8 @@ INITIALIZE_PASS_END(InstructionSelect, DEBUG_TYPE,
6262
"Select target instructions out of generic instructions",
6363
false, false)
6464

65-
InstructionSelect::InstructionSelect(CodeGenOptLevel OL)
66-
: MachineFunctionPass(ID), OptLevel(OL) {}
67-
68-
// In order not to crash when calling getAnalysis during testing with -run-pass
69-
// we use the default opt level here instead of None, so that the addRequired()
70-
// calls are made in getAnalysisUsage().
71-
InstructionSelect::InstructionSelect()
72-
: MachineFunctionPass(ID), OptLevel(CodeGenOptLevel::Default) {}
65+
InstructionSelect::InstructionSelect(CodeGenOptLevel OL, char &PassID)
66+
: MachineFunctionPass(PassID), OptLevel(OL) {}
7367

7468
void InstructionSelect::getAnalysisUsage(AnalysisUsage &AU) const {
7569
AU.addRequired<TargetPassConfig>();

0 commit comments

Comments
 (0)