|
1 | | -// RUN: llvm-tblgen -gen-intrinsic-impl -I %p/../../include %s | FileCheck %s |
| 1 | +// RUN: llvm-tblgen -gen-intrinsic-impl -I %p/../../include -DTEST_INTRINSICS_SUPPRESS_DEFS %s | FileCheck %s |
2 | 2 |
|
3 | | -// Get the minimum blurb necessary to process ... |
4 | | -include "llvm/CodeGen/ValueTypes.td" |
5 | | -include "llvm/CodeGen/SDNodeProperties.td" |
6 | | - |
7 | | -class LLVMType<ValueType vt> { |
8 | | - ValueType VT = vt; |
9 | | - int isAny = 0; |
10 | | -} |
11 | | - |
12 | | -def llvm_i32_ty : LLVMType<i32>; |
13 | | -def llvm_ptr_ty : LLVMType<iPTR>; |
14 | | - |
15 | | -class AttrIndex<int idx> { |
16 | | - int Value = idx; |
17 | | -} |
18 | | - |
19 | | -def FuncIndex : AttrIndex<-1>; |
20 | | -def RetIndex : AttrIndex<0>; |
21 | | -class ArgIndex<int argNo> : AttrIndex<!add(argNo, 1)>; |
22 | | - |
23 | | -class IntrinsicProperty<bit is_default = 0> { |
24 | | - bit IsDefault = is_default; |
25 | | -} |
26 | | - |
27 | | -def IntrNoMem : IntrinsicProperty; |
28 | | -def IntrHasSideEffects : IntrinsicProperty; |
29 | | -class Dereferenceable<AttrIndex idx, int bytes> : IntrinsicProperty { |
30 | | - int ArgNo = idx.Value; |
31 | | - int Bytes = bytes; |
32 | | -} |
33 | | - |
34 | | -class Intrinsic<list<LLVMType> ret_types, |
35 | | - list<LLVMType> param_types = [], |
36 | | - list<IntrinsicProperty> intr_properties = [], |
37 | | - string name = "", |
38 | | - list<SDNodeProperty> sd_properties = [], |
39 | | - bit disable_default_attributes = 0> : SDPatternOperator { |
40 | | - string LLVMName = name; |
41 | | - string TargetPrefix = ""; |
42 | | - list<LLVMType> RetTypes = ret_types; |
43 | | - list<LLVMType> ParamTypes = param_types; |
44 | | - list<IntrinsicProperty> IntrProperties = intr_properties; |
45 | | - let Properties = sd_properties; |
46 | | - bit DisableDefaultAttributes = 1; |
47 | | - |
48 | | - |
49 | | - bit isTarget = 0; |
50 | | - bit DisableDefaultAttributes = disable_default_attributes; |
51 | | -} |
| 3 | +include "llvm/IR/Intrinsics.td" |
52 | 4 |
|
53 | 5 | // ... this intrinsic. |
54 | 6 | def int_random_gen : Intrinsic<[llvm_i32_ty], [], [IntrNoMem, IntrHasSideEffects]>; |
|
0 commit comments