OSDN Git Service

[GlobalISel] Add a way for targets to enable GISel.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Wed, 1 Mar 2017 23:33:08 +0000 (23:33 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Wed, 1 Mar 2017 23:33:08 +0000 (23:33 +0000)
commitb424c9db34e2ead1f9000366813ccf7991e9b941
tree2ab14ea9e510ec705b98aaa9fdd5c3a198b965f6
parent2880f2df26a37ba10b26701f16f111e6a783e73f
[GlobalISel] Add a way for targets to enable GISel.

Until now, we've had to use -global-isel to enable GISel.  But using
that on other targets that don't support it will result in an abort, as we
can't build a full pipeline.
Additionally, we want to experiment with enabling GISel by default for
some targets: we can't just enable GISel by default, even among those
target that do have some support, because the level of support varies.

This first step adds an override for the target to explicitly define its
level of support.  For AArch64, do that using
a new command-line option (I know..):
  -aarch64-enable-global-isel-at-O=<N>
Where N is the opt-level below which GISel should be used.

Default that to -1, so that we still don't enable GISel anywhere.
We're not there yet!

While there, remove a couple LLVM_UNLIKELYs.  Building the pipeline is
such a cold path that in practice that shouldn't matter at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296710 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/TargetPassConfig.h
lib/CodeGen/LLVMTargetMachine.cpp
lib/CodeGen/TargetPassConfig.cpp
lib/Target/AArch64/AArch64TargetMachine.cpp
test/CodeGen/AArch64/GlobalISel/gisel-commandline-option.ll [new file with mode: 0644]