• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-tblgen -gen-intrinsic %s | FileCheck %s
2
3class IntrinsicProperty;
4
5class ValueType<int size, int value> {
6  string Namespace = "MVT";
7  int Size = size;
8  int Value = value;
9}
10
11class LLVMType<ValueType vt> {
12  ValueType VT = vt;
13}
14
15class Intrinsic<string name, list<LLVMType> param_types = []> {
16  string LLVMName = name;
17  bit isTarget = 0;
18  string TargetPrefix = "";
19  list<LLVMType> RetTypes = [];
20  list<LLVMType> ParamTypes = param_types;
21  list<IntrinsicProperty> Properties = [];
22}
23
24def iAny : ValueType<0, 254>;
25def llvm_anyint_ty : LLVMType<iAny>;
26
27
28// Make sure an intrinsic name that is a prefix of another is checked after the
29// other.
30
31// CHECK: if (NameR.startswith("oo.bar.")) return Intrinsic::foo_bar;
32// CHECK: if (NameR.startswith("oo.")) return Intrinsic::foo;
33
34def int_foo : Intrinsic<"llvm.foo", [llvm_anyint_ty]>;
35def int_foo_bar : Intrinsic<"llvm.foo.bar", [llvm_anyint_ty]>;
36