diff options
author | Quentin Colombet <qcolombet@apple.com> | 2016-08-27 00:18:24 +0000 |
---|---|---|
committer | Quentin Colombet <qcolombet@apple.com> | 2016-08-27 00:18:24 +0000 |
commit | 6049524d37de125850fffd1c2e571c96dcaad97b (patch) | |
tree | af70ee89ad10c5273d9878acf628d07d4df94742 /llvm/lib/CodeGen | |
parent | aea50f8b84527110d5c3a4a238154eec4539b4a2 (diff) | |
download | bcm5719-llvm-6049524d37de125850fffd1c2e571c96dcaad97b.tar.gz bcm5719-llvm-6049524d37de125850fffd1c2e571c96dcaad97b.zip |
[GlobalISel] Teach the core pipeline not to run if ISel failed.
llvm-svn: 279889
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/MachineLegalizePass.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp | 5 |
3 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp index 4ef4c43f763..302c3763d00 100644 --- a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp +++ b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp @@ -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(); diff --git a/llvm/lib/CodeGen/GlobalISel/MachineLegalizePass.cpp b/llvm/lib/CodeGen/GlobalISel/MachineLegalizePass.cpp index bf5025201ba..33d050bbcc6 100644 --- a/llvm/lib/CodeGen/GlobalISel/MachineLegalizePass.cpp +++ b/llvm/lib/CodeGen/GlobalISel/MachineLegalizePass.cpp @@ -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(); diff --git a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp index bf88d742dba..9efe48adec7 100644 --- a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp +++ b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp @@ -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; |