[MachineOutliner] Add `useMachineOutliner` target hook
authorJessica Paquette <jpaquette@apple.com>
Wed, 4 Apr 2018 19:13:31 +0000 (19:13 +0000)
committerJessica Paquette <jpaquette@apple.com>
Wed, 4 Apr 2018 19:13:31 +0000 (19:13 +0000)
commitbccd18b816c0413f63b14ccb77077cced6f033f7
tree5229911afb5c62cfe8e4848899b504bc4e2523a5
parentf7c5a10e55103ea8c8c46c7d9f0bbae50e39f96e
[MachineOutliner] Add `useMachineOutliner` target hook

The MachineOutliner has a bunch of target hooks that will call llvm_unreachable
if the target doesn't implement them. Therefore, if you enable the outliner on
such a target, it'll just crash. It'd be much better if it'd just *not* run
the outliner at all in this case.

This commit adds a hook to TargetInstrInfo that returns false by default.
Targets that implement the hook make it return true. The outliner checks the
return value of this hook to decide whether or not to continue.

llvm-svn: 329220
llvm/include/llvm/CodeGen/TargetInstrInfo.h
llvm/lib/CodeGen/MachineOutliner.cpp
llvm/lib/Target/AArch64/AArch64InstrInfo.h
llvm/lib/Target/X86/X86InstrInfo.h