File: intrinsic-pointer-to-any.td

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (53 lines) | stat: -rw-r--r-- 1,494 bytes parent folder | download | duplicates (4)
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
// RUN: llvm-tblgen -gen-intrinsic-impl %s | FileCheck %s

// This test is validating that it an Intrinsic with an LLVMPointerType to
// llvm_any_ty still properly work after r363233. That patch rewrote the
// substitution handling code in the Intrinsic Emitter, and didn't consider this
// case, so TableGen would hit an assertion in EncodeFixedType that was checking
// to ensure that the substitution being processed was correctly replaced.

class IntrinsicProperty;
class SDNodeProperty;

class ValueType<int size, int value> {
  string Namespace = "MVT";
  int Size = size;
  int Value = value;
}

def iPTR   : ValueType<0  , 254>;
def Any    : ValueType<0  , 255>;

class LLVMType<ValueType vt> {
  ValueType VT = vt;
  int isAny = 0;
}


class Intrinsic<list<LLVMType> ret_types> {
  string LLVMName = "";
  string TargetPrefix = "";   // Set to a prefix for target-specific intrinsics.
  list<LLVMType> RetTypes = ret_types;
  list<LLVMType> ParamTypes = [];
  list<IntrinsicProperty> IntrProperties = [];
  list<SDNodeProperty> Properties = [];
  bit isTarget = 0;
}

class LLVMQualPointerType<LLVMType elty>
  : LLVMType<iPTR>{
  LLVMType ElTy = elty;
  int AddrSpace = 0;
}

class LLVMPointerType<LLVMType elty>
  : LLVMQualPointerType<elty>;

let isAny = 1 in {
  def llvm_any_ty        : LLVMType<Any>;
}
def i8 : ValueType<8, 3>;
def llvm_i8_ty : LLVMType<i8>;

def int_has_ptr_to_any : Intrinsic<[LLVMPointerType<llvm_any_ty>, llvm_i8_ty]>;
// CHECK: /* 0 */ 21, 14, 15, 0, 2, 0