1 //===- AMDILProfiles.td - AMD IL Profiles ------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //==-----------------------------------------------------------------------===//
9 // These are used for custom selection dag type profiles
11 //===----------------------------------------------------------------------===//
12 // Custom Selection DAG Type Profiles
13 //===----------------------------------------------------------------------===//
14 // SDTCisDP - The specified operand has double type
15 // Tablegen needs to be hacked to get this constraint to work
16 //class SDTCisDP<int OpNum> : SDTypeConstraint<OpNum>;
18 //===----------------------------------------------------------------------===//
19 // Generic Profile Types
20 //===----------------------------------------------------------------------===//
22 def SDTIL_GenUnaryOp : SDTypeProfile<1, 1, [
25 def SDTIL_GenBinaryOp : SDTypeProfile<1, 2, [
26 SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>
28 def SDTIL_GenTernaryOp : SDTypeProfile<1, 3, [
29 SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>, SDTCisSameAs<2, 3>
31 def SDTIL_GenCMovLog : SDTypeProfile<1, 3, [
32 SDTCisSameAs<0, 2>, SDTCisSameAs<2, 3>, SDTCisInt<1>
34 def SDTIL_GenVecBuild : SDTypeProfile<1, 1, [
38 def SDTIL_GenVecExtract : SDTypeProfile<1, 2, [
39 SDTCisEltOfVec<0, 1>, SDTCisVT<2, i32>
42 def SDTIL_GenVecInsert : SDTypeProfile<1, 4, [
43 SDTCisEltOfVec<2, 1>, SDTCisSameAs<0, 1>,
44 SDTCisVT<3, i32>, SDTCisVT<4, i32>
47 def SDTIL_GenVecShuffle : SDTypeProfile <1, 2, [
48 SDTCisSameAs<0, 1>, SDTCisVT<2, i32>
51 def SDTIL_GenVecConcat : SDTypeProfile <1, 2, [
54 //===----------------------------------------------------------------------===//
55 // Conversion Profile Types
56 //===----------------------------------------------------------------------===//
57 def SDTIL_DPToFPOp : SDTypeProfile<1, 1, [
58 SDTCisFP<0>, SDTCisFP<1>, SDTCisOpSmallerThanOp<0, 1>
61 def SDTIL_AnyToInt : SDTypeProfile<1, 1, [
64 def SDTIL_IntToAny : SDTypeProfile<1, 1, [
67 def SDTIL_GenBitConv : SDTypeProfile<1, 1, []>;
68 //===----------------------------------------------------------------------===//
69 // Scalar Profile Types
70 //===----------------------------------------------------------------------===//
72 // Add instruction pattern to handle offsets of memory operationns
73 def SDTIL_AddAddrri: SDTypeProfile<1, 2, [
74 SDTCisInt<0>, SDTCisPtrTy<1>, SDTCisSameAs<0, 2>
76 def SDTIL_AddAddrir : SDTypeProfile<1, 2, [
77 SDTCisInt<0>, SDTCisPtrTy<2>, SDTCisSameAs<0, 1>
80 def SDTIL_LCreate : SDTypeProfile<1, 2, [
81 SDTCisVT<0, i64>, SDTCisVT<1, i32>, SDTCisSameAs<1, 2>
83 def SDTIL_LCreate2 : SDTypeProfile<1, 2, [
84 SDTCisVT<0, v2i64>, SDTCisVT<1, v2i32>, SDTCisSameAs<1, 2>
86 def SDTIL_LComp : SDTypeProfile<1, 1, [
87 SDTCisVT<0, i32>, SDTCisVT<1, i64>
89 def SDTIL_LComp2 : SDTypeProfile<1, 1, [
90 SDTCisVT<0, v2i32>, SDTCisVT<1, v2i64>
92 def SDTIL_DCreate : SDTypeProfile<1, 2, [
93 SDTCisVT<0, f64>, SDTCisVT<1, i32>, SDTCisSameAs<1, 2>
95 def SDTIL_DComp : SDTypeProfile<1, 1, [
96 SDTCisVT<0, i32>, SDTCisVT<1, f64>
98 def SDTIL_DCreate2 : SDTypeProfile<1, 2, [
99 SDTCisVT<0, v2f64>, SDTCisVT<1, v2i32>, SDTCisSameAs<1, 2>
101 def SDTIL_DComp2 : SDTypeProfile<1, 1, [
102 SDTCisVT<0, v2i32>, SDTCisVT<1, v2f64>
104 //===----------------------------------------------------------------------===//
105 // Flow Control Profile Types
106 //===----------------------------------------------------------------------===//
107 // Profile for Normal Call
108 def SDTIL_Call : SDTypeProfile<0, 1, [
111 // Branch instruction where second and third are basic blocks
112 def SDTIL_BRCond : SDTypeProfile<0, 2, [
115 // Comparison instruction
116 def SDTIL_Cmp : SDTypeProfile<1, 3, [
117 SDTCisSameAs<0, 2>, SDTCisSameAs<2,3>, SDTCisVT<1, i32>
121 //===----------------------------------------------------------------------===//
122 // Call Sequence Profiles
123 //===----------------------------------------------------------------------===//
124 def SDTIL_CallSeqStart : SDCallSeqStart< [
127 def SDTIL_CallSeqEnd : SDCallSeqEnd< [
128 SDTCisVT<0, i32>, SDTCisVT<1, i32>
131 //===----------------------------------------------------------------------===//
132 // Image Operation Profiles
133 //===----------------------------------------------------------------------===//
134 def SDTIL_ImageRead : SDTypeProfile<1, 3,
135 [SDTCisVT<0, v4i32>, SDTCisPtrTy<1>, SDTCisVT<2, i32>, SDTCisVT<3, v4f32>]>;
136 def SDTIL_ImageWrite : SDTypeProfile<0, 3,
137 [SDTCisPtrTy<0>, SDTCisVT<1, v2i32>, SDTCisVT<2, v4i32>]>;
138 def SDTIL_ImageWrite3D : SDTypeProfile<0, 3,
139 [SDTCisPtrTy<0>, SDTCisVT<1, v4i32>, SDTCisVT<2, v4i32>]>;
140 def SDTIL_ImageInfo : SDTypeProfile<1, 1,
141 [SDTCisVT<0, v4i32>, SDTCisPtrTy<1>]>;
142 //===----------------------------------------------------------------------===//
143 // Atomic Operation Profiles
144 //===----------------------------------------------------------------------===//
145 def SDTIL_UniAtomNoRet : SDTypeProfile<0, 2, [
146 SDTCisPtrTy<0>, SDTCisVT<1, i32>
148 def SDTIL_BinAtomNoRet : SDTypeProfile<0, 3, [
149 SDTCisPtrTy<0>, SDTCisVT<1, i32>, SDTCisVT<2, i32>
151 def SDTIL_TriAtomNoRet : SDTypeProfile<0, 4, [
152 SDTCisPtrTy<0>, SDTCisVT<1, i32>, SDTCisVT<2, i32>, SDTCisVT<3, i32>
154 def SDTIL_UniAtom : SDTypeProfile<1, 2, [
155 SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, i32>
157 def SDTIL_BinAtom : SDTypeProfile<1, 3, [
158 SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, i32>, SDTCisVT<3, i32>
160 def SDTIL_TriAtom : SDTypeProfile<1, 4, [
161 SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, i32>,
162 SDTCisVT<3, i32>, SDTCisVT<4, i32>
165 def SDTIL_BinAtomFloat : SDTypeProfile<1, 3, [
166 SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, f32>, SDTCisVT<3, f32>
168 def SDTIL_BinAtomNoRetFloat : SDTypeProfile<0, 3, [
169 SDTCisPtrTy<0>, SDTCisVT<1, f32>, SDTCisVT<2, f32>
172 def SDTIL_Append : SDTypeProfile<1, 1, [
173 SDTCisVT<0, i32>, SDTCisPtrTy<1>