blob: 6f79b4bcc5cd9abf71779baf957e9241996fe1a6 [file] [log] [blame]
Chris Lattnerc860eca2004-08-01 05:04:00 +00001//===- CodeGenInstruction.h - Instruction Class Wrapper ---------*- C++ -*-===//
Misha Brukman650ba8e2005-04-22 00:00:37 +00002//
Chris Lattnerc860eca2004-08-01 05:04:00 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattner8adcd9f2007-12-29 20:37:13 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Misha Brukman650ba8e2005-04-22 00:00:37 +00007//
Chris Lattnerc860eca2004-08-01 05:04:00 +00008//===----------------------------------------------------------------------===//
9//
10// This file defines a wrapper class for the 'Instruction' TableGen class.
11//
12//===----------------------------------------------------------------------===//
13
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000014#ifndef LLVM_UTILS_TABLEGEN_CODEGENINSTRUCTION_H
15#define LLVM_UTILS_TABLEGEN_CODEGENINSTRUCTION_H
Chris Lattnerc860eca2004-08-01 05:04:00 +000016
Chris Lattner8ffd1292010-11-06 06:39:47 +000017#include "llvm/ADT/StringRef.h"
David Blaikie13e77db2018-03-23 23:58:25 +000018#include "llvm/Support/MachineValueType.h"
Craig Topperf7ce7242015-06-08 01:35:40 +000019#include "llvm/Support/SMLoc.h"
Chris Lattnerc860eca2004-08-01 05:04:00 +000020#include <string>
Chris Lattnerc860eca2004-08-01 05:04:00 +000021#include <utility>
Chandler Carruth91d19d82012-12-04 10:37:14 +000022#include <vector>
Chris Lattnerc860eca2004-08-01 05:04:00 +000023
24namespace llvm {
Mehdi Aminib550cb12016-04-18 09:17:29 +000025template <typename T> class ArrayRef;
Chris Lattnerc860eca2004-08-01 05:04:00 +000026 class Record;
Chris Lattner6bc03042005-11-19 07:05:57 +000027 class DagInit;
Chris Lattner7bc5d9b2010-03-27 20:09:24 +000028 class CodeGenTarget;
Jim Grosbach876ee072011-03-14 17:32:49 +000029
Chris Lattnerd8adec72010-11-01 04:03:32 +000030 class CGIOperandList {
Jeff Cohen7d6f3db2006-11-05 19:31:28 +000031 public:
Chris Lattnera9dfb1b2010-02-10 01:45:28 +000032 class ConstraintInfo {
33 enum { None, EarlyClobber, Tied } Kind;
34 unsigned OtherTiedOperand;
35 public:
36 ConstraintInfo() : Kind(None) {}
Jim Grosbach876ee072011-03-14 17:32:49 +000037
Chris Lattnera9dfb1b2010-02-10 01:45:28 +000038 static ConstraintInfo getEarlyClobber() {
39 ConstraintInfo I;
40 I.Kind = EarlyClobber;
Chris Lattner0d7b5e52010-02-10 21:22:51 +000041 I.OtherTiedOperand = 0;
Chris Lattnera9dfb1b2010-02-10 01:45:28 +000042 return I;
43 }
Jim Grosbach876ee072011-03-14 17:32:49 +000044
Chris Lattnera9dfb1b2010-02-10 01:45:28 +000045 static ConstraintInfo getTied(unsigned Op) {
46 ConstraintInfo I;
47 I.Kind = Tied;
48 I.OtherTiedOperand = Op;
49 return I;
50 }
Jim Grosbach876ee072011-03-14 17:32:49 +000051
Chris Lattnera9dfb1b2010-02-10 01:45:28 +000052 bool isNone() const { return Kind == None; }
53 bool isEarlyClobber() const { return Kind == EarlyClobber; }
54 bool isTied() const { return Kind == Tied; }
Jim Grosbach876ee072011-03-14 17:32:49 +000055
Chris Lattnera9dfb1b2010-02-10 01:45:28 +000056 unsigned getTiedOperand() const {
57 assert(isTied());
58 return OtherTiedOperand;
59 }
60 };
Jim Grosbach2f0be8f2010-10-08 18:09:59 +000061
Chris Lattner3bc477a2004-08-11 02:22:39 +000062 /// OperandInfo - The information we keep track of for each operand in the
63 /// operand list for a tablegen instruction.
Chris Lattner55726822004-08-01 07:42:39 +000064 struct OperandInfo {
Chris Lattner3bc477a2004-08-11 02:22:39 +000065 /// Rec - The definition this operand is declared as.
Chris Lattner220d0012005-08-19 16:57:28 +000066 ///
Chris Lattner55726822004-08-01 07:42:39 +000067 Record *Rec;
Jim Grosbach876ee072011-03-14 17:32:49 +000068
Chris Lattner3bc477a2004-08-11 02:22:39 +000069 /// Name - If this operand was assigned a symbolic name, this is it,
70 /// otherwise, it's empty.
Chris Lattner55726822004-08-01 07:42:39 +000071 std::string Name;
Jim Grosbach876ee072011-03-14 17:32:49 +000072
Chris Lattner3bc477a2004-08-11 02:22:39 +000073 /// PrinterMethodName - The method used to print operands of this type in
74 /// the asmprinter.
75 std::string PrinterMethodName;
Jim Grosbach876ee072011-03-14 17:32:49 +000076
Jim Grosbach51a12eb2010-10-12 22:21:57 +000077 /// EncoderMethodName - The method used to get the machine operand value
78 /// for binary encoding. "getMachineOpValue" by default.
79 std::string EncoderMethodName;
Jim Grosbach876ee072011-03-14 17:32:49 +000080
Benjamin Kramerc8dc46b2011-07-14 21:47:18 +000081 /// OperandType - A value from MCOI::OperandType representing the type of
82 /// the operand.
83 std::string OperandType;
84
Chris Lattner3bc477a2004-08-11 02:22:39 +000085 /// MIOperandNo - Currently (this is meant to be phased out), some logical
86 /// operands correspond to multiple MachineInstr operands. In the X86
87 /// target for example, one address operand is represented as 4
88 /// MachineOperands. Because of this, the operand number in the
89 /// OperandList may not match the MachineInstr operand num. Until it
90 /// does, this contains the MI operand index of this operand.
91 unsigned MIOperandNo;
Chris Lattner17727ba2005-08-18 23:38:41 +000092 unsigned MINumOperands; // The number of operands.
Jim Grosbach876ee072011-03-14 17:32:49 +000093
Chris Lattner78a403f2006-11-15 23:23:02 +000094 /// DoNotEncode - Bools are set to true in this vector for each operand in
95 /// the DisableEncoding list. These should not be emitted by the code
96 /// emitter.
97 std::vector<bool> DoNotEncode;
Jim Grosbach876ee072011-03-14 17:32:49 +000098
Nate Begemane479ccb2005-11-30 23:58:18 +000099 /// MIOperandInfo - Default MI operand type. Note an operand may be made
100 /// up of multiple MI operands.
David Greeneaf8ee2c2011-07-29 22:43:06 +0000101 DagInit *MIOperandInfo;
Jim Grosbach876ee072011-03-14 17:32:49 +0000102
Chris Lattnerc94f2142006-11-15 02:38:17 +0000103 /// Constraint info for this operand. This operand can have pieces, so we
104 /// track constraint info for each.
Chris Lattnera9dfb1b2010-02-10 01:45:28 +0000105 std::vector<ConstraintInfo> Constraints;
Jim Grosbach876ee072011-03-14 17:32:49 +0000106
Jim Grosbach2f0be8f2010-10-08 18:09:59 +0000107 OperandInfo(Record *R, const std::string &N, const std::string &PMN,
Benjamin Kramerc8dc46b2011-07-14 21:47:18 +0000108 const std::string &EMN, const std::string &OT, unsigned MION,
David Greeneaf8ee2c2011-07-29 22:43:06 +0000109 unsigned MINO, DagInit *MIOI)
Chris Lattnerd8adec72010-11-01 04:03:32 +0000110 : Rec(R), Name(N), PrinterMethodName(PMN), EncoderMethodName(EMN),
Benjamin Kramerc8dc46b2011-07-14 21:47:18 +0000111 OperandType(OT), MIOperandNo(MION), MINumOperands(MINO),
112 MIOperandInfo(MIOI) {}
Jim Grosbach876ee072011-03-14 17:32:49 +0000113
114
Chris Lattnere032dbf2010-11-02 22:55:03 +0000115 /// getTiedOperand - If this operand is tied to another one, return the
116 /// other operand number. Otherwise, return -1.
117 int getTiedRegister() const {
118 for (unsigned j = 0, e = Constraints.size(); j != e; ++j) {
119 const CGIOperandList::ConstraintInfo &CI = Constraints[j];
120 if (CI.isTied()) return CI.getTiedOperand();
121 }
122 return -1;
123 }
Chris Lattner55726822004-08-01 07:42:39 +0000124 };
Jim Grosbach876ee072011-03-14 17:32:49 +0000125
Chris Lattnerd8adec72010-11-01 04:03:32 +0000126 CGIOperandList(Record *D);
Jim Grosbach876ee072011-03-14 17:32:49 +0000127
Chris Lattnerd8adec72010-11-01 04:03:32 +0000128 Record *TheDef; // The actual record containing this OperandList.
Misha Brukman650ba8e2005-04-22 00:00:37 +0000129
Chris Lattner5f418ea2010-03-18 20:50:52 +0000130 /// NumDefs - Number of def operands declared, this is the number of
131 /// elements in the instruction's (outs) list.
Evan Cheng94b5a802007-07-19 01:14:50 +0000132 ///
133 unsigned NumDefs;
Jim Grosbach876ee072011-03-14 17:32:49 +0000134
Chris Lattnerc860eca2004-08-01 05:04:00 +0000135 /// OperandList - The list of declared operands, along with their declared
136 /// type (which is a record).
Chris Lattner55726822004-08-01 07:42:39 +0000137 std::vector<OperandInfo> OperandList;
Jim Grosbach876ee072011-03-14 17:32:49 +0000138
Chris Lattnerd8adec72010-11-01 04:03:32 +0000139 // Information gleaned from the operand list.
140 bool isPredicable;
141 bool hasOptionalDef;
142 bool isVariadic;
Jim Grosbach876ee072011-03-14 17:32:49 +0000143
Chris Lattnerd8adec72010-11-01 04:03:32 +0000144 // Provide transparent accessors to the operand list.
Chris Lattner90803912011-04-17 22:24:13 +0000145 bool empty() const { return OperandList.empty(); }
Chris Lattnerd8adec72010-11-01 04:03:32 +0000146 unsigned size() const { return OperandList.size(); }
147 const OperandInfo &operator[](unsigned i) const { return OperandList[i]; }
148 OperandInfo &operator[](unsigned i) { return OperandList[i]; }
149 OperandInfo &back() { return OperandList.back(); }
150 const OperandInfo &back() const { return OperandList.back(); }
Jim Grosbach876ee072011-03-14 17:32:49 +0000151
Jim Grosbach0e28a352014-04-18 02:08:58 +0000152 typedef std::vector<OperandInfo>::iterator iterator;
153 typedef std::vector<OperandInfo>::const_iterator const_iterator;
154 iterator begin() { return OperandList.begin(); }
155 const_iterator begin() const { return OperandList.begin(); }
156 iterator end() { return OperandList.end(); }
157 const_iterator end() const { return OperandList.end(); }
158
Chris Lattnerd8adec72010-11-01 04:03:32 +0000159 /// getOperandNamed - Return the index of the operand with the specified
160 /// non-empty name. If the instruction does not have an operand with the
Joerg Sonnenberger635debe2012-10-25 20:33:17 +0000161 /// specified name, abort.
Chris Lattnerd8adec72010-11-01 04:03:32 +0000162 unsigned getOperandNamed(StringRef Name) const;
Jim Grosbach876ee072011-03-14 17:32:49 +0000163
Chris Lattnerd8adec72010-11-01 04:03:32 +0000164 /// hasOperandNamed - Query whether the instruction has an operand of the
165 /// given name. If so, return true and set OpIdx to the index of the
166 /// operand. Otherwise, return false.
167 bool hasOperandNamed(StringRef Name, unsigned &OpIdx) const;
Jim Grosbach876ee072011-03-14 17:32:49 +0000168
Chris Lattnerd8adec72010-11-01 04:03:32 +0000169 /// ParseOperandName - Parse an operand name like "$foo" or "$foo.bar",
170 /// where $foo is a whole operand and $foo.bar refers to a suboperand.
Joerg Sonnenberger635debe2012-10-25 20:33:17 +0000171 /// This aborts if the name is invalid. If AllowWholeOp is true, references
172 /// to operands with suboperands are allowed, otherwise not.
Chris Lattnerd8adec72010-11-01 04:03:32 +0000173 std::pair<unsigned,unsigned> ParseOperandName(const std::string &Op,
174 bool AllowWholeOp = true);
Jim Grosbach876ee072011-03-14 17:32:49 +0000175
Chris Lattnerd8adec72010-11-01 04:03:32 +0000176 /// getFlattenedOperandNumber - Flatten a operand/suboperand pair into a
177 /// flat machineinstr operand #.
178 unsigned getFlattenedOperandNumber(std::pair<unsigned,unsigned> Op) const {
179 return OperandList[Op.first].MIOperandNo + Op.second;
180 }
Jim Grosbach876ee072011-03-14 17:32:49 +0000181
Chris Lattnerd8adec72010-11-01 04:03:32 +0000182 /// getSubOperandNumber - Unflatten a operand number into an
183 /// operand/suboperand pair.
184 std::pair<unsigned,unsigned> getSubOperandNumber(unsigned Op) const {
185 for (unsigned i = 0; ; ++i) {
186 assert(i < OperandList.size() && "Invalid flat operand #");
187 if (OperandList[i].MIOperandNo+OperandList[i].MINumOperands > Op)
188 return std::make_pair(i, Op-OperandList[i].MIOperandNo);
189 }
190 }
Jim Grosbach876ee072011-03-14 17:32:49 +0000191
192
Chris Lattnerd8adec72010-11-01 04:03:32 +0000193 /// isFlatOperandNotEmitted - Return true if the specified flat operand #
194 /// should not be emitted with the code emitter.
195 bool isFlatOperandNotEmitted(unsigned FlatOpNo) const {
196 std::pair<unsigned,unsigned> Op = getSubOperandNumber(FlatOpNo);
197 if (OperandList[Op.first].DoNotEncode.size() > Op.second)
198 return OperandList[Op.first].DoNotEncode[Op.second];
199 return false;
200 }
Jim Grosbach876ee072011-03-14 17:32:49 +0000201
Chris Lattnerd8adec72010-11-01 04:03:32 +0000202 void ProcessDisableEncoding(std::string Value);
203 };
Jim Grosbach876ee072011-03-14 17:32:49 +0000204
Chris Lattnerd8adec72010-11-01 04:03:32 +0000205
206 class CodeGenInstruction {
207 public:
208 Record *TheDef; // The actual record defining this instruction.
Craig Topper86a9aee2017-07-07 06:22:35 +0000209 StringRef Namespace; // The namespace the instruction is in.
Chris Lattnerd8adec72010-11-01 04:03:32 +0000210
211 /// AsmString - The format string used to emit a .s file for the
212 /// instruction.
213 std::string AsmString;
214
215 /// Operands - This is information about the (ins) and (outs) list specified
216 /// to the instruction.
217 CGIOperandList Operands;
Chris Lattnerc860eca2004-08-01 05:04:00 +0000218
Chris Lattner2130a3e2010-03-18 21:42:03 +0000219 /// ImplicitDefs/ImplicitUses - These are lists of registers that are
220 /// implicitly defined and used by the instruction.
221 std::vector<Record*> ImplicitDefs, ImplicitUses;
222
Chris Lattnerc860eca2004-08-01 05:04:00 +0000223 // Various boolean values we track for the instruction.
Craig Topperbc9486b2014-02-05 09:10:40 +0000224 bool isReturn : 1;
Heejin Ahned5e06b2018-08-21 19:44:11 +0000225 bool isEHScopeReturn : 1;
Craig Topperbc9486b2014-02-05 09:10:40 +0000226 bool isBranch : 1;
227 bool isIndirectBranch : 1;
228 bool isCompare : 1;
229 bool isMoveImm : 1;
Petar Jovanovicc0510002018-05-23 15:28:28 +0000230 bool isMoveReg : 1;
Craig Topperbc9486b2014-02-05 09:10:40 +0000231 bool isBitcast : 1;
232 bool isSelect : 1;
233 bool isBarrier : 1;
234 bool isCall : 1;
Sjoerd Meijer724023a2016-09-14 08:20:03 +0000235 bool isAdd : 1;
Joel Galenson06e7e572018-07-13 15:19:33 +0000236 bool isTrap : 1;
Craig Topperbc9486b2014-02-05 09:10:40 +0000237 bool canFoldAsLoad : 1;
238 bool mayLoad : 1;
239 bool mayLoad_Unset : 1;
240 bool mayStore : 1;
241 bool mayStore_Unset : 1;
242 bool isPredicable : 1;
243 bool isConvertibleToThreeAddress : 1;
244 bool isCommutable : 1;
245 bool isTerminator : 1;
246 bool isReMaterializable : 1;
247 bool hasDelaySlot : 1;
248 bool usesCustomInserter : 1;
249 bool hasPostISelHook : 1;
250 bool hasCtrlDep : 1;
251 bool isNotDuplicable : 1;
252 bool hasSideEffects : 1;
253 bool hasSideEffects_Unset : 1;
Craig Topperbc9486b2014-02-05 09:10:40 +0000254 bool isAsCheapAsAMove : 1;
255 bool hasExtraSrcRegAllocReq : 1;
256 bool hasExtraDefRegAllocReq : 1;
257 bool isCodeGenOnly : 1;
258 bool isPseudo : 1;
Quentin Colombetd533cdf2014-08-11 22:17:14 +0000259 bool isRegSequence : 1;
Quentin Colombet7e75cba2014-08-20 21:51:26 +0000260 bool isExtractSubreg : 1;
Quentin Colombet7e3da662014-08-20 23:49:36 +0000261 bool isInsertSubreg : 1;
Owen Andersonabaa5232015-05-28 18:33:39 +0000262 bool isConvergent : 1;
Matthias Braun8e0a7342016-03-01 20:03:11 +0000263 bool hasNoSchedulingInfo : 1;
Simon Dardis13de5552018-05-22 14:36:58 +0000264 bool FastISelShouldIgnore : 1;
Ulrich Weigandc48aefb2018-07-13 13:18:00 +0000265 bool hasChain : 1;
266 bool hasChain_Inferred : 1;
Jim Grosbach2f0be8f2010-10-08 18:09:59 +0000267
Joey Gouly0e76fa72013-09-12 10:28:05 +0000268 std::string DeprecatedReason;
269 bool HasComplexDeprecationPredicate;
270
Jakob Stoklund Olesen94ed4d42012-08-24 00:31:16 +0000271 /// Are there any undefined flags?
272 bool hasUndefFlags() const {
273 return mayLoad_Unset || mayStore_Unset || hasSideEffects_Unset;
274 }
275
276 // The record used to infer instruction flags, or NULL if no flag values
277 // have been inferred.
278 Record *InferredFrom;
Chris Lattnerc860eca2004-08-01 05:04:00 +0000279
Chris Lattnera3977162010-11-01 02:15:23 +0000280 CodeGenInstruction(Record *R);
Chris Lattner55726822004-08-01 07:42:39 +0000281
Chris Lattner7bc5d9b2010-03-27 20:09:24 +0000282 /// HasOneImplicitDefWithKnownVT - If the instruction has at least one
283 /// implicit def and it has a known VT, return the VT, otherwise return
284 /// MVT::Other.
Jim Grosbach2f0be8f2010-10-08 18:09:59 +0000285 MVT::SimpleValueType
Chris Lattner7bc5d9b2010-03-27 20:09:24 +0000286 HasOneImplicitDefWithKnownVT(const CodeGenTarget &TargetInfo) const;
Jim Grosbach876ee072011-03-14 17:32:49 +0000287
288
Chris Lattner25d9c7f2010-11-01 01:07:14 +0000289 /// FlattenAsmStringVariants - Flatten the specified AsmString to only
290 /// include text from the specified variant, returning the new string.
291 static std::string FlattenAsmStringVariants(StringRef AsmString,
292 unsigned Variant);
Daniel Sandersc54aa9c2017-11-18 00:16:44 +0000293
294 // Is the specified operand in a generic instruction implicitly a pointer.
295 // This can be used on intructions that use typeN or ptypeN to identify
296 // operands that should be considered as pointers even though SelectionDAG
297 // didn't make a distinction between integer and pointers.
298 bool isOperandAPointer(unsigned i) const;
Chris Lattnerc860eca2004-08-01 05:04:00 +0000299 };
Jim Grosbach876ee072011-03-14 17:32:49 +0000300
301
Chris Lattner488c2012010-11-01 04:05:41 +0000302 /// CodeGenInstAlias - This represents an InstAlias definition.
303 class CodeGenInstAlias {
304 public:
305 Record *TheDef; // The actual record defining this InstAlias.
Jim Grosbach876ee072011-03-14 17:32:49 +0000306
Chris Lattner488c2012010-11-01 04:05:41 +0000307 /// AsmString - The format string used to emit a .s file for the
308 /// instruction.
309 std::string AsmString;
Jim Grosbach876ee072011-03-14 17:32:49 +0000310
Chris Lattnerdd3b09c2010-11-01 05:34:34 +0000311 /// Result - The result instruction.
David Greeneaf8ee2c2011-07-29 22:43:06 +0000312 DagInit *Result;
Jim Grosbach876ee072011-03-14 17:32:49 +0000313
Chris Lattner8ffd1292010-11-06 06:39:47 +0000314 /// ResultInst - The instruction generated by the alias (decoded from
315 /// Result).
316 CodeGenInstruction *ResultInst;
Jim Grosbach876ee072011-03-14 17:32:49 +0000317
318
Chris Lattner8ffd1292010-11-06 06:39:47 +0000319 struct ResultOperand {
Chris Lattnerb6f8e822010-11-06 19:25:43 +0000320 private:
Owen Andersonda6bd3e2012-06-08 00:25:03 +0000321 std::string Name;
Chris Lattner8ffd1292010-11-06 06:39:47 +0000322 Record *R;
Jim Grosbach876ee072011-03-14 17:32:49 +0000323
Chris Lattnerb6f8e822010-11-06 19:25:43 +0000324 int64_t Imm;
Jim Grosbach876ee072011-03-14 17:32:49 +0000325 public:
Chris Lattnerb6f8e822010-11-06 19:25:43 +0000326 enum {
327 K_Record,
Chris Lattner4869d342010-11-06 19:57:21 +0000328 K_Imm,
329 K_Reg
Chris Lattnerb6f8e822010-11-06 19:25:43 +0000330 } Kind;
Jim Grosbach876ee072011-03-14 17:32:49 +0000331
Benjamin Kramer82de7d32016-05-27 14:27:24 +0000332 ResultOperand(std::string N, Record *r)
333 : Name(std::move(N)), R(r), Kind(K_Record) {}
Chris Lattnerb6f8e822010-11-06 19:25:43 +0000334 ResultOperand(int64_t I) : Imm(I), Kind(K_Imm) {}
Chris Lattner4869d342010-11-06 19:57:21 +0000335 ResultOperand(Record *r) : R(r), Kind(K_Reg) {}
Chris Lattnerb6f8e822010-11-06 19:25:43 +0000336
337 bool isRecord() const { return Kind == K_Record; }
338 bool isImm() const { return Kind == K_Imm; }
Chris Lattner4869d342010-11-06 19:57:21 +0000339 bool isReg() const { return Kind == K_Reg; }
Jim Grosbach876ee072011-03-14 17:32:49 +0000340
Chris Lattnerb6f8e822010-11-06 19:25:43 +0000341 StringRef getName() const { assert(isRecord()); return Name; }
342 Record *getRecord() const { assert(isRecord()); return R; }
343 int64_t getImm() const { assert(isImm()); return Imm; }
Chris Lattner4869d342010-11-06 19:57:21 +0000344 Record *getRegister() const { assert(isReg()); return R; }
Tim Northover60091cf2014-05-15 13:36:01 +0000345
346 unsigned getMINumOperands() const;
Chris Lattner8ffd1292010-11-06 06:39:47 +0000347 };
Jim Grosbach876ee072011-03-14 17:32:49 +0000348
Chris Lattner8ffd1292010-11-06 06:39:47 +0000349 /// ResultOperands - The decoded operands for the result instruction.
350 std::vector<ResultOperand> ResultOperands;
Bob Wilsonf3f28352011-01-20 18:38:02 +0000351
Bob Wilsonb9b24222011-01-26 19:44:55 +0000352 /// ResultInstOperandIndex - For each operand, this vector holds a pair of
353 /// indices to identify the corresponding operand in the result
354 /// instruction. The first index specifies the operand and the second
355 /// index specifies the suboperand. If there are no suboperands or if all
356 /// of them are matched by the operand, the second value should be -1.
357 std::vector<std::pair<unsigned, int> > ResultInstOperandIndex;
Jim Grosbach876ee072011-03-14 17:32:49 +0000358
Craig Topper2be74392018-06-18 01:28:01 +0000359 CodeGenInstAlias(Record *R, CodeGenTarget &T);
Bob Wilsonb9b24222011-01-26 19:44:55 +0000360
David Greeneaf8ee2c2011-07-29 22:43:06 +0000361 bool tryAliasOpMatch(DagInit *Result, unsigned AliasOpNo,
Jakob Stoklund Olesend7b66962012-08-22 23:33:58 +0000362 Record *InstOpRec, bool hasSubOps, ArrayRef<SMLoc> Loc,
Bob Wilsonb9b24222011-01-26 19:44:55 +0000363 CodeGenTarget &T, ResultOperand &ResOp);
Jim Grosbach876ee072011-03-14 17:32:49 +0000364 };
Chris Lattner488c2012010-11-01 04:05:41 +0000365}
Chris Lattnerc860eca2004-08-01 05:04:00 +0000366
367#endif