[GlobalISel] Teach the core pipeline not to run if ISel failed.

llvm-svn: 279889
This commit is contained in:
Quentin Colombet 2016-08-27 00:18:24 +00:00
parent aea50f8b84
commit 6049524d37
3 changed files with 14 additions and 0 deletions

View File

@ -43,6 +43,11 @@ static void reportSelectionError(const MachineInstr &MI, const Twine &Message) {
}
bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) {
// If the ISel pipeline failed, do not bother running that pass.
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
return false;
DEBUG(dbgs() << "Selecting function: " << MF.getName() << '\n');
const InstructionSelector *ISel = MF.getSubtarget().getInstructionSelector();

View File

@ -37,6 +37,10 @@ void MachineLegalizePass::init(MachineFunction &MF) {
}
bool MachineLegalizePass::runOnMachineFunction(MachineFunction &MF) {
// If the ISel pipeline failed, do not bother running that pass.
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
return false;
DEBUG(dbgs() << "Legalize Machine IR for: " << MF.getName() << '\n');
init(MF);
const MachineLegalizer &Legalizer = *MF.getSubtarget().getMachineLegalizer();

View File

@ -537,6 +537,11 @@ void RegBankSelect::assignInstr(MachineInstr &MI) {
}
bool RegBankSelect::runOnMachineFunction(MachineFunction &MF) {
// If the ISel pipeline failed, do not bother running that pass.
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
return false;
DEBUG(dbgs() << "Assign register banks for: " << MF.getName() << '\n');
const Function *F = MF.getFunction();
Mode SaveOptMode = OptMode;