File: skipped-nodes.td

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (92 lines) | stat: -rw-r--r-- 4,007 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// RUN: llvm-tblgen -gen-sd-node-info -I %p/../../../include %s 2> %t.warn | FileCheck %s
// RUN: FileCheck --check-prefix=WARN --implicit-check-not=warning %s < %t.warn

// RUN: llvm-tblgen -gen-sd-node-info -warn-on-skipped-nodes=false \
// RUN:   -I %p/../../../include %s 2> %t.nowarn | FileCheck %s
// RUN: not test -s %t.nowarn

include "llvm/Target/Target.td"

def MyTarget : Target;

// WARN: [[#@LINE+1]]:5: warning: skipped node: invalid enum name
def bad_name_1 : SDNode<"", SDTypeProfile<0, 0, []>>;

// WARN: [[#@LINE+1]]:5: warning: skipped node: invalid enum name
def bad_name_2 : SDNode<"NODE", SDTypeProfile<0, 0, []>>;

// WARN: [[#@LINE+1]]:5: warning: skipped node: invalid enum name
def bad_name_3 : SDNode<"MyTargetISD::", SDTypeProfile<0, 0, []>>;

// WARN: [[#@LINE+1]]:5: warning: skipped node: invalid enum name
def bad_name_4 : SDNode<"MyISD::", SDTypeProfile<0, 0, []>>;

// WARN: [[#@LINE+1]]:5: warning: skipped node: invalid enum name
def bad_name_5 : SDNode<"::NODE", SDTypeProfile<0, 0, []>>;


// Standard namespace.
def silent_1 : SDNode<"ISD::SILENT", SDTypeProfile<0, 0, []>>;

// Different namespace.
def silent_2 : SDNode<"MyISD::SILENT", SDTypeProfile<0, 0, []>>;


// Different number of results.
// WARN: [[#@LINE+2]]:5: warning: skipped node: incompatible description
// WARN: [[#@LINE+2]]:5: warning: skipped node: incompatible description
def node_1a : SDNode<"MyTargetISD::NODE_1", SDTypeProfile<0, 0, []>>;
def node_1b : SDNode<"MyTargetISD::NODE_1", SDTypeProfile<1, 0, []>>;

// Different number of operands.
// WARN: [[#@LINE+2]]:5: warning: skipped node: incompatible description
// WARN: [[#@LINE+2]]:5: warning: skipped node: incompatible description
def node_2a : SDNode<"MyTargetISD::NODE_2", SDTypeProfile<0, 0, []>>;
def node_2b : SDNode<"MyTargetISD::NODE_2", SDTypeProfile<0, 1, []>>;

// Different value of IsStrictFP.
// WARN: [[#@LINE+3]]:5: warning: skipped node: incompatible description
// WARN: [[#@LINE+3]]:5: warning: skipped node: incompatible description
let IsStrictFP = true in
def node_3a : SDNode<"MyTargetISD::NODE_3", SDTypeProfile<0, 0, []>>;
def node_3b : SDNode<"MyTargetISD::NODE_3", SDTypeProfile<0, 0, []>>;

// Different value of TSFlags.
// WARN: [[#@LINE+3]]:5: warning: skipped node: incompatible description
// WARN: [[#@LINE+3]]:5: warning: skipped node: incompatible description
let TSFlags = 1 in
def node_4a : SDNode<"MyTargetISD::NODE_4", SDTypeProfile<0, 0, []>>;
def node_4b : SDNode<"MyTargetISD::NODE_4", SDTypeProfile<0, 0, []>>;

// Different properties.
// WARN: [[#@LINE+2]]:5: warning: skipped node: incompatible description
// WARN: [[#@LINE+2]]:5: warning: skipped node: incompatible description
def node_5a : SDNode<"MyTargetISD::NODE_5", SDTypeProfile<0, 0, []>>;
def node_5b : SDNode<"MyTargetISD::NODE_5", SDTypeProfile<0, 0, []>, [SDNPHasChain]>;


// CHECK:       enum GenNodeType : unsigned {
// CHECK-NEXT:    COMPAT = ISD::BUILTIN_OP_END,
// CHECK-NEXT:  };

// CHECK:       static constexpr char MyTargetSDNodeNamesStorage[] =
// CHECK-NEXT:    "\0"
// CHECK-NEXT:    "MyTargetISD::COMPAT\0"
// CHECK-NEXT:    ;

// CHECK:       static const SDTypeConstraint MyTargetSDTypeConstraints[] = {
// CHECK-NEXT:    /* dummy */ {SDTCisVT, 0, 0, MVT::INVALID_SIMPLE_VALUE_TYPE}
// CHECK-NEXT:  };
// CHECK-EMPTY:
// CHECK-NEXT:  static const SDNodeDesc MyTargetSDNodeDescs[] = {
// CHECK-NEXT:      {1, -1, 0, 0, 0, 1, 0, 0}, // COMPAT
// CHECK-NEXT:  };
// CHECK-EMPTY:
// CHECK-NEXT:  static const SDNodeInfo MyTargetGenSDNodeInfo(
// CHECK-NEXT:      /*NumOpcodes=*/1, MyTargetSDNodeDescs,
// CHECK-NEXT:      MyTargetSDNodeNames, MyTargetSDTypeConstraints);

def compat_a : SDNode<"MyTargetISD::COMPAT", SDTypeProfile<1, -1, []>>;
def compat_b : SDNode<"MyTargetISD::COMPAT", SDTypeProfile<1, -1, [SDTCisVT<0, untyped>]>>;
def compat_c : SDNode<"MyTargetISD::COMPAT", SDTypeProfile<1, -1, [SDTCisVT<0, untyped>]>,
    [SDNPCommutative, SDNPAssociative, SDNPMayStore, SDNPMayLoad, SDNPSideEffect]>;