]> granicus.if.org Git - llvm/commit
[globalisel][tablegen] Import SelectionDAG's rule predicates and support the equivale...
authorDaniel Sanders <daniel_l_sanders@apple.com>
Fri, 21 Apr 2017 15:59:56 +0000 (15:59 +0000)
committerDaniel Sanders <daniel_l_sanders@apple.com>
Fri, 21 Apr 2017 15:59:56 +0000 (15:59 +0000)
commite8660ea63d010af3afd8c56812e4602081cf19e4
tree2f78f540137b0ec5e727d8673e0ee48f8e2f4b64
parent4f4553914f61a7366e121ecb5f7087bb462f35f2
[globalisel][tablegen] Import SelectionDAG's rule predicates and support the equivalent in GIRule.

Summary:
The SelectionDAG importer now imports rules with Predicate's attached via
Requires, PredicateControl, etc. These predicates are implemented as
bitset's to allow multiple predicates to be tested together. However,
unlike the MC layer subtarget features, each target only pays for it's own
predicates (e.g. AArch64 doesn't have 192 feature bits just because X86
needs a lot).

Both AArch64 and X86 derive at least one predicate from the MachineFunction
or Function so they must re-initialize AvailableFeatures before each
function. They also declare locals in <Target>InstructionSelector so that
computeAvailableFeatures() can use the code from SelectionDAG without
modification.

Reviewers: rovka, qcolombet, aditya_nandakumar, t.p.northover, ab

Reviewed By: rovka

Subscribers: aemerson, rengolin, dberris, kristof.beyls, llvm-commits, igorb

Differential Revision: https://reviews.llvm.org/D31418

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300993 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
include/llvm/CodeGen/GlobalISel/InstructionSelector.h
lib/Target/AArch64/AArch64InstructionSelector.cpp
lib/Target/X86/X86.h
lib/Target/X86/X86InstructionSelector.cpp
lib/Target/X86/X86TargetMachine.cpp
test/TableGen/GlobalISelEmitter.td
utils/TableGen/AsmMatcherEmitter.cpp
utils/TableGen/CodeEmitterGen.cpp
utils/TableGen/GlobalISelEmitter.cpp
utils/TableGen/SubtargetFeatureInfo.cpp
utils/TableGen/SubtargetFeatureInfo.h
utils/TableGen/Types.cpp