OSDN Git Service

[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)
commit7d72684477ec16b8f4b0bd9241d7878fea45564f
tree1dca552c21ab1c6f5594ec057cb42e647d8072af
parent75627b1a254023729ccbc9335101fbc5756d2fb7
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329220 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/TargetInstrInfo.h
lib/CodeGen/MachineOutliner.cpp
lib/Target/AArch64/AArch64InstrInfo.h
lib/Target/X86/X86InstrInfo.h