]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/include/llvm/Target/GlobalISel/Target.td
Merge compiler-rt trunk r300890, and update build glue.
[FreeBSD/FreeBSD.git] / contrib / llvm / include / llvm / Target / GlobalISel / Target.td
1 //===- Target.td - Define GlobalISel rules -----------------*- tablegen -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines the target-independent interfaces used to support
11 // SelectionDAG instruction selection patterns (specified in
12 // TargetSelectionDAG.td) when generating GlobalISel instruction selectors.
13 //
14 // This is intended as a compatibility layer, to enable reuse of target
15 // descriptions written for SelectionDAG without requiring explicit GlobalISel
16 // support.  It will eventually supersede SelectionDAG patterns.
17 //
18 //===----------------------------------------------------------------------===//
19
20 // Definitions that inherit from LLT define types that will be used in the
21 // GlobalISel matcher.
22 class LLT;
23
24 def s32 : LLT;
25 def s64 : LLT;
26
27 // Defines a matcher for complex operands. This is analogous to ComplexPattern
28 // from SelectionDAG.
29 //
30 // Definitions that inherit from this may also inherit from
31 // GIComplexPatternEquiv to enable the import of SelectionDAG patterns involving
32 // those ComplexPatterns.
33 class GIComplexOperandMatcher<LLT type, dag operands, string matcherfn> {
34   // The expected type of the root of the match.
35   //
36   // TODO: We should probably support, any-type, any-scalar, and multiple types
37   //       in the future.
38   LLT Type = type;
39
40   // The operands that result from a successful match
41   // Should be of the form '(ops ty1, ty2, ...)' where ty1/ty2 are definitions
42   // that inherit from Operand.
43   //
44   // FIXME: Which definition is used for ty1/ty2 doesn't actually matter at the
45   //        moment. Only the number of operands is used.
46   dag Operands = operands;
47
48   // The function that determines whether the operand matches. It should be of
49   // the form:
50   //   bool select(const MatchOperand &Root, MatchOperand &Result1)
51   // and should have the same number of ResultX arguments as the number of
52   // result operands. It must return true on successful match and false
53   // otherwise. If it returns true, then all the ResultX arguments must be
54   // overwritten.
55   string MatcherFn = matcherfn;
56 }