aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineOutliner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/MachineOutliner.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineOutliner.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp
index 2a6a94d..932316f 100644
--- a/llvm/lib/CodeGen/MachineOutliner.cpp
+++ b/llvm/lib/CodeGen/MachineOutliner.cpp
@@ -1416,7 +1416,15 @@ bool MachineOutliner::runOnModule(Module &M) {
MMI.getOrCreateMachineFunction(*M.begin()).getSubtarget();
const TargetRegisterInfo *TRI = STI.getRegisterInfo();
const TargetInstrInfo *TII = STI.getInstrInfo();
-
+
+ // Does the target implement the MachineOutliner? If it doesn't, quit here.
+ if (!TII->useMachineOutliner()) {
+ // No. So we're done.
+ DEBUG(dbgs()
+ << "Skipping pass: Target does not support the MachineOutliner.\n");
+ return false;
+ }
+
InstructionMapper Mapper;
// Build instruction mappings for each function in the module. Start by