LLVM  14.0.0git
InlineAsm.h
Go to the documentation of this file.
1 //===- llvm/InlineAsm.h - Class to represent inline asm strings -*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This class represents the inline asm strings, which are Value*'s that are
10 // used as the callee operand of call instructions. InlineAsm's are uniqued
11 // like constants, and created via InlineAsm::get(...).
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_IR_INLINEASM_H
16 #define LLVM_IR_INLINEASM_H
17 
18 #include "llvm/ADT/StringRef.h"
19 #include "llvm/IR/Value.h"
21 #include <cassert>
22 #include <string>
23 #include <vector>
24 
25 namespace llvm {
26 
27 class FunctionType;
28 class PointerType;
29 template <class ConstantClass> class ConstantUniqueMap;
30 
31 class InlineAsm final : public Value {
32 public:
33  enum AsmDialect {
36  };
37 
38 private:
39  friend struct InlineAsmKeyType;
41 
42  std::string AsmString, Constraints;
43  FunctionType *FTy;
44  bool HasSideEffects;
45  bool IsAlignStack;
46  AsmDialect Dialect;
47  bool CanThrow;
48 
49  InlineAsm(FunctionType *Ty, const std::string &AsmString,
50  const std::string &Constraints, bool hasSideEffects,
51  bool isAlignStack, AsmDialect asmDialect, bool canThrow);
52 
53  /// When the ConstantUniqueMap merges two types and makes two InlineAsms
54  /// identical, it destroys one of them with this method.
55  void destroyConstant();
56 
57 public:
58  InlineAsm(const InlineAsm &) = delete;
59  InlineAsm &operator=(const InlineAsm &) = delete;
60 
61  /// InlineAsm::get - Return the specified uniqued inline asm string.
62  ///
63  static InlineAsm *get(FunctionType *Ty, StringRef AsmString,
64  StringRef Constraints, bool hasSideEffects,
65  bool isAlignStack = false,
66  AsmDialect asmDialect = AD_ATT, bool canThrow = false);
67 
68  bool hasSideEffects() const { return HasSideEffects; }
69  bool isAlignStack() const { return IsAlignStack; }
70  AsmDialect getDialect() const { return Dialect; }
71  bool canThrow() const { return CanThrow; }
72 
73  /// getType - InlineAsm's are always pointers.
74  ///
75  PointerType *getType() const {
76  return reinterpret_cast<PointerType*>(Value::getType());
77  }
78 
79  /// getFunctionType - InlineAsm's are always pointers to functions.
80  ///
82 
83  const std::string &getAsmString() const { return AsmString; }
84  const std::string &getConstraintString() const { return Constraints; }
85 
86  /// Verify - This static method can be used by the parser to check to see if
87  /// the specified constraint string is legal for the type. This returns true
88  /// if legal, false if not.
89  ///
90  static bool Verify(FunctionType *Ty, StringRef Constraints);
91 
92  // Constraint String Parsing
94  isInput, // 'x'
95  isOutput, // '=x'
96  isClobber // '~x'
97  };
98 
99  using ConstraintCodeVector = std::vector<std::string>;
100 
102  /// MatchingInput - If this is not -1, this is an output constraint where an
103  /// input constraint is required to match it (e.g. "0"). The value is the
104  /// constraint number that matches this one (for example, if this is
105  /// constraint #0 and constraint #4 has the value "0", this will be 4).
106  int MatchingInput = -1;
107 
108  /// Code - The constraint code, either the register name (in braces) or the
109  /// constraint letter/number.
111 
112  /// Default constructor.
113  SubConstraintInfo() = default;
114  };
115 
116  using SubConstraintInfoVector = std::vector<SubConstraintInfo>;
117  struct ConstraintInfo;
118  using ConstraintInfoVector = std::vector<ConstraintInfo>;
119 
120  struct ConstraintInfo {
121  /// Type - The basic type of the constraint: input/output/clobber
122  ///
124 
125  /// isEarlyClobber - "&": output operand writes result before inputs are all
126  /// read. This is only ever set for an output operand.
127  bool isEarlyClobber = false;
128 
129  /// MatchingInput - If this is not -1, this is an output constraint where an
130  /// input constraint is required to match it (e.g. "0"). The value is the
131  /// constraint number that matches this one (for example, if this is
132  /// constraint #0 and constraint #4 has the value "0", this will be 4).
133  int MatchingInput = -1;
134 
135  /// hasMatchingInput - Return true if this is an output constraint that has
136  /// a matching input constraint.
137  bool hasMatchingInput() const { return MatchingInput != -1; }
138 
139  /// isCommutative - This is set to true for a constraint that is commutative
140  /// with the next operand.
141  bool isCommutative = false;
142 
143  /// isIndirect - True if this operand is an indirect operand. This means
144  /// that the address of the source or destination is present in the call
145  /// instruction, instead of it being returned or passed in explicitly. This
146  /// is represented with a '*' in the asm string.
147  bool isIndirect = false;
148 
149  /// Code - The constraint code, either the register name (in braces) or the
150  /// constraint letter/number.
152 
153  /// isMultipleAlternative - '|': has multiple-alternative constraints.
154  bool isMultipleAlternative = false;
155 
156  /// multipleAlternatives - If there are multiple alternative constraints,
157  /// this array will contain them. Otherwise it will be empty.
159 
160  /// The currently selected alternative constraint index.
162 
163  /// Default constructor.
164  ConstraintInfo() = default;
165 
166  /// Parse - Analyze the specified string (e.g. "=*&{eax}") and fill in the
167  /// fields in this structure. If the constraint string is not understood,
168  /// return true, otherwise return false.
169  bool Parse(StringRef Str, ConstraintInfoVector &ConstraintsSoFar);
170 
171  /// selectAlternative - Point this constraint to the alternative constraint
172  /// indicated by the index.
173  void selectAlternative(unsigned index);
174  };
175 
176  /// ParseConstraints - Split up the constraint string into the specific
177  /// constraints and their prefixes. If this returns an empty vector, and if
178  /// the constraint string itself isn't empty, there was an error parsing.
179  static ConstraintInfoVector ParseConstraints(StringRef ConstraintString);
180 
181  /// ParseConstraints - Parse the constraints of this inlineasm object,
182  /// returning them the same way that ParseConstraints(str) does.
184  return ParseConstraints(Constraints);
185  }
186 
187  // Methods for support type inquiry through isa, cast, and dyn_cast:
188  static bool classof(const Value *V) {
189  return V->getValueID() == Value::InlineAsmVal;
190  }
191 
192  // These are helper methods for dealing with flags in the INLINEASM SDNode
193  // in the backend.
194  //
195  // The encoding of the flag word is currently:
196  // Bits 2-0 - A Kind_* value indicating the kind of the operand.
197  // Bits 15-3 - The number of SDNode operands associated with this inline
198  // assembly operand.
199  // If bit 31 is set:
200  // Bit 30-16 - The operand number that this operand must match.
201  // When bits 2-0 are Kind_Mem, the Constraint_* value must be
202  // obtained from the flags for this operand number.
203  // Else if bits 2-0 are Kind_Mem:
204  // Bit 30-16 - A Constraint_* value indicating the original constraint
205  // code.
206  // Else:
207  // Bit 30-16 - The register class ID to use for the operand.
208 
209  enum : uint32_t {
210  // Fixed operands on an INLINEASM SDNode.
214  Op_ExtraInfo = 3, // HasSideEffects, IsAlignStack, AsmDialect.
216 
217  // Fixed operands on an INLINEASM MachineInstr.
219  MIOp_ExtraInfo = 1, // HasSideEffects, IsAlignStack, AsmDialect.
221 
222  // Interpretation of the MIOp_ExtraInfo bit field.
229 
230  // Inline asm operands map to multiple SDNode / MachineInstr operands.
231  // The first operand is an immediate describing the asm operand, the low
232  // bits is the kind:
233  Kind_RegUse = 1, // Input register, "r".
234  Kind_RegDef = 2, // Output register, "=r".
235  Kind_RegDefEarlyClobber = 3, // Early-clobber output register, "=&r".
236  Kind_Clobber = 4, // Clobbered register, "~r".
237  Kind_Imm = 5, // Immediate.
238  Kind_Mem = 6, // Memory operand, "m".
239 
240  // Memory constraint codes.
241  // These could be tablegenerated but there's little need to do that since
242  // there's plenty of space in the encoding to support the union of all
243  // constraint codes for all targets.
268 
269  Flag_MatchingOperand = 0x80000000
270  };
271 
272  static unsigned getFlagWord(unsigned Kind, unsigned NumOps) {
273  assert(((NumOps << 3) & ~0xffff) == 0 && "Too many inline asm operands!");
274  assert(Kind >= Kind_RegUse && Kind <= Kind_Mem && "Invalid Kind");
275  return Kind | (NumOps << 3);
276  }
277 
278  static bool isRegDefKind(unsigned Flag){ return getKind(Flag) == Kind_RegDef;}
279  static bool isImmKind(unsigned Flag) { return getKind(Flag) == Kind_Imm; }
280  static bool isMemKind(unsigned Flag) { return getKind(Flag) == Kind_Mem; }
281  static bool isRegDefEarlyClobberKind(unsigned Flag) {
283  }
284  static bool isClobberKind(unsigned Flag) {
285  return getKind(Flag) == Kind_Clobber;
286  }
287 
288  /// getFlagWordForMatchingOp - Augment an existing flag word returned by
289  /// getFlagWord with information indicating that this input operand is tied
290  /// to a previous output operand.
291  static unsigned getFlagWordForMatchingOp(unsigned InputFlag,
292  unsigned MatchedOperandNo) {
293  assert(MatchedOperandNo <= 0x7fff && "Too big matched operand");
294  assert((InputFlag & ~0xffff) == 0 && "High bits already contain data");
295  return InputFlag | Flag_MatchingOperand | (MatchedOperandNo << 16);
296  }
297 
298  /// getFlagWordForRegClass - Augment an existing flag word returned by
299  /// getFlagWord with the required register class for the following register
300  /// operands.
301  /// A tied use operand cannot have a register class, use the register class
302  /// from the def operand instead.
303  static unsigned getFlagWordForRegClass(unsigned InputFlag, unsigned RC) {
304  // Store RC + 1, reserve the value 0 to mean 'no register class'.
305  ++RC;
306  assert(!isImmKind(InputFlag) && "Immediates cannot have a register class");
307  assert(!isMemKind(InputFlag) && "Memory operand cannot have a register class");
308  assert(RC <= 0x7fff && "Too large register class ID");
309  assert((InputFlag & ~0xffff) == 0 && "High bits already contain data");
310  return InputFlag | (RC << 16);
311  }
312 
313  /// Augment an existing flag word returned by getFlagWord with the constraint
314  /// code for a memory constraint.
315  static unsigned getFlagWordForMem(unsigned InputFlag, unsigned Constraint) {
316  assert(isMemKind(InputFlag) && "InputFlag is not a memory constraint!");
317  assert(Constraint <= 0x7fff && "Too large a memory constraint ID");
318  assert(Constraint <= Constraints_Max && "Unknown constraint ID");
319  assert((InputFlag & ~0xffff) == 0 && "High bits already contain data");
320  return InputFlag | (Constraint << Constraints_ShiftAmount);
321  }
322 
323  static unsigned convertMemFlagWordToMatchingFlagWord(unsigned InputFlag) {
324  assert(isMemKind(InputFlag));
325  return InputFlag & ~(0x7fff << Constraints_ShiftAmount);
326  }
327 
328  static unsigned getKind(unsigned Flags) {
329  return Flags & 7;
330  }
331 
332  static unsigned getMemoryConstraintID(unsigned Flag) {
334  return (Flag >> Constraints_ShiftAmount) & 0x7fff;
335  }
336 
337  /// getNumOperandRegisters - Extract the number of registers field from the
338  /// inline asm operand flag.
339  static unsigned getNumOperandRegisters(unsigned Flag) {
340  return (Flag & 0xffff) >> 3;
341  }
342 
343  /// isUseOperandTiedToDef - Return true if the flag of the inline asm
344  /// operand indicates it is an use operand that's matched to a def operand.
345  static bool isUseOperandTiedToDef(unsigned Flag, unsigned &Idx) {
346  if ((Flag & Flag_MatchingOperand) == 0)
347  return false;
348  Idx = (Flag & ~Flag_MatchingOperand) >> 16;
349  return true;
350  }
351 
352  /// hasRegClassConstraint - Returns true if the flag contains a register
353  /// class constraint. Sets RC to the register class ID.
354  static bool hasRegClassConstraint(unsigned Flag, unsigned &RC) {
356  return false;
357  unsigned High = Flag >> 16;
358  // getFlagWordForRegClass() uses 0 to mean no register class, and otherwise
359  // stores RC + 1.
360  if (!High)
361  return false;
362  RC = High - 1;
363  return true;
364  }
365 
366  static std::vector<StringRef> getExtraInfoNames(unsigned ExtraInfo) {
367  std::vector<StringRef> Result;
368  if (ExtraInfo & InlineAsm::Extra_HasSideEffects)
369  Result.push_back("sideeffect");
370  if (ExtraInfo & InlineAsm::Extra_MayLoad)
371  Result.push_back("mayload");
372  if (ExtraInfo & InlineAsm::Extra_MayStore)
373  Result.push_back("maystore");
374  if (ExtraInfo & InlineAsm::Extra_IsConvergent)
375  Result.push_back("isconvergent");
376  if (ExtraInfo & InlineAsm::Extra_IsAlignStack)
377  Result.push_back("alignstack");
378 
379  AsmDialect Dialect =
381 
382  if (Dialect == InlineAsm::AD_ATT)
383  Result.push_back("attdialect");
384  if (Dialect == InlineAsm::AD_Intel)
385  Result.push_back("inteldialect");
386 
387  return Result;
388  }
389 
390  static StringRef getKindName(unsigned Kind) {
391  switch (Kind) {
393  return "reguse";
395  return "regdef";
397  return "regdef-ec";
399  return "clobber";
400  case InlineAsm::Kind_Imm:
401  return "imm";
402  case InlineAsm::Kind_Mem:
403  return "mem";
404  default:
405  llvm_unreachable("Unknown operand kind");
406  }
407  }
408 
409  static StringRef getMemConstraintName(unsigned Constraint) {
410  switch (Constraint) {
412  return "es";
414  return "i";
416  return "m";
418  return "o";
420  return "v";
422  return "Q";
424  return "R";
426  return "S";
428  return "T";
430  return "Um";
432  return "Un";
434  return "Uq";
436  return "Us";
438  return "Ut";
440  return "Uv";
442  return "Uy";
444  return "X";
446  return "Z";
448  return "ZC";
450  return "Zy";
451  default:
452  llvm_unreachable("Unknown memory constraint");
453  }
454  }
455 };
456 
457 } // end namespace llvm
458 
459 #endif // LLVM_IR_INLINEASM_H
llvm::InlineAsm::ConstraintInfo::MatchingInput
int MatchingInput
MatchingInput - If this is not -1, this is an output constraint where an input constraint is required...
Definition: InlineAsm.h:133
llvm::InlineAsm::Constraint_Zy
@ Constraint_Zy
Definition: InlineAsm.h:265
PointerType
Definition: ItaniumDemangle.h:598
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::InlineAsm::AsmDialect
AsmDialect
Definition: InlineAsm.h:33
llvm::InlineAsm::Flag_MatchingOperand
@ Flag_MatchingOperand
Definition: InlineAsm.h:269
llvm::InlineAsm::ConstraintInfo::isCommutative
bool isCommutative
isCommutative - This is set to true for a constraint that is commutative with the next operand.
Definition: InlineAsm.h:141
llvm::InlineAsm::Constraint_S
@ Constraint_S
Definition: InlineAsm.h:253
FunctionType
Definition: ItaniumDemangle.h:783
llvm::InlineAsm::ConstraintInfoVector
std::vector< ConstraintInfo > ConstraintInfoVector
Definition: InlineAsm.h:118
llvm::InlineAsm::getAsmString
const std::string & getAsmString() const
Definition: InlineAsm.h:83
llvm::InlineAsm::Kind_RegDefEarlyClobber
@ Kind_RegDefEarlyClobber
Definition: InlineAsm.h:235
llvm::InlineAsm::Constraint_A
@ Constraint_A
Definition: InlineAsm.h:250
StringRef.h
llvm::InlineAsm::getKindName
static StringRef getKindName(unsigned Kind)
Definition: InlineAsm.h:390
llvm::InlineAsm::isAlignStack
bool isAlignStack() const
Definition: InlineAsm.h:69
llvm::InlineAsm::ConstraintInfo::isIndirect
bool isIndirect
isIndirect - True if this operand is an indirect operand.
Definition: InlineAsm.h:147
llvm::InlineAsm::AD_ATT
@ AD_ATT
Definition: InlineAsm.h:34
llvm::InlineAsm::Constraint_Uv
@ Constraint_Uv
Definition: InlineAsm.h:260
llvm::InlineAsm::Op_FirstOperand
@ Op_FirstOperand
Definition: InlineAsm.h:215
High
uint64_t High
Definition: NVVMIntrRange.cpp:61
llvm::InlineAsm::Constraint_X
@ Constraint_X
Definition: InlineAsm.h:262
llvm::InlineAsm::Constraint_Z
@ Constraint_Z
Definition: InlineAsm.h:263
llvm::InlineAsm::convertMemFlagWordToMatchingFlagWord
static unsigned convertMemFlagWordToMatchingFlagWord(unsigned InputFlag)
Definition: InlineAsm.h:323
llvm::InlineAsm::Kind_RegUse
@ Kind_RegUse
Definition: InlineAsm.h:233
ErrorHandling.h
llvm::InlineAsm::Constraint_o
@ Constraint_o
Definition: InlineAsm.h:248
llvm::InlineAsm::isUseOperandTiedToDef
static bool isUseOperandTiedToDef(unsigned Flag, unsigned &Idx)
isUseOperandTiedToDef - Return true if the flag of the inline asm operand indicates it is an use oper...
Definition: InlineAsm.h:345
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
llvm::InlineAsm::Constraint_es
@ Constraint_es
Definition: InlineAsm.h:245
llvm::InlineAsm::ConstraintInfo::Parse
bool Parse(StringRef Str, ConstraintInfoVector &ConstraintsSoFar)
Parse - Analyze the specified string (e.g.
Definition: InlineAsm.cpp:64
llvm::InlineAsm::Constraint_Us
@ Constraint_Us
Definition: InlineAsm.h:258
llvm::InlineAsm::getFunctionType
FunctionType * getFunctionType() const
getFunctionType - InlineAsm's are always pointers to functions.
Definition: InlineAsm.cpp:57
llvm::InlineAsm::getType
PointerType * getType() const
getType - InlineAsm's are always pointers.
Definition: InlineAsm.h:75
llvm::InlineAsm::Kind_Clobber
@ Kind_Clobber
Definition: InlineAsm.h:236
llvm::InlineAsm::Extra_AsmDialect
@ Extra_AsmDialect
Definition: InlineAsm.h:225
llvm::InlineAsm::Kind_Mem
@ Kind_Mem
Definition: InlineAsm.h:238
llvm::InlineAsm::classof
static bool classof(const Value *V)
Definition: InlineAsm.h:188
llvm::InlineAsm::ConstraintInfo::currentAlternativeIndex
unsigned currentAlternativeIndex
The currently selected alternative constraint index.
Definition: InlineAsm.h:161
llvm::InlineAsm::Op_ExtraInfo
@ Op_ExtraInfo
Definition: InlineAsm.h:214
llvm::InlineAsm::Constraint_Un
@ Constraint_Un
Definition: InlineAsm.h:256
llvm::InlineAsm::Constraint_Q
@ Constraint_Q
Definition: InlineAsm.h:251
llvm::InlineAsmKeyType
Definition: ConstantsContext.h:452
llvm::InlineAsm::hasSideEffects
bool hasSideEffects() const
Definition: InlineAsm.h:68
llvm::InlineAsm::Kind_Imm
@ Kind_Imm
Definition: InlineAsm.h:237
llvm::InlineAsm::Extra_IsAlignStack
@ Extra_IsAlignStack
Definition: InlineAsm.h:224
llvm::InlineAsm::isInput
@ isInput
Definition: InlineAsm.h:94
llvm::InlineAsm::Constraint_v
@ Constraint_v
Definition: InlineAsm.h:249
llvm::Value::getValueID
unsigned getValueID() const
Return an ID for the concrete type of this object.
Definition: Value.h:532
llvm::InlineAsm::isRegDefKind
static bool isRegDefKind(unsigned Flag)
Definition: InlineAsm.h:278
llvm::MCID::Flag
Flag
These should be considered private to the implementation of the MCInstrDesc class.
Definition: MCInstrDesc.h:146
llvm::ConstantUniqueMap
Definition: InlineAsm.h:29
llvm::InlineAsm::Constraint_ZC
@ Constraint_ZC
Definition: InlineAsm.h:264
llvm::InlineAsm::getDialect
AsmDialect getDialect() const
Definition: InlineAsm.h:70
llvm::InlineAsm::Constraint_T
@ Constraint_T
Definition: InlineAsm.h:254
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
llvm::InlineAsm::get
static InlineAsm * get(FunctionType *Ty, StringRef AsmString, StringRef Constraints, bool hasSideEffects, bool isAlignStack=false, AsmDialect asmDialect=AD_ATT, bool canThrow=false)
InlineAsm::get - Return the specified uniqued inline asm string.
Definition: InlineAsm.cpp:42
llvm::InlineAsm::getKind
static unsigned getKind(unsigned Flags)
Definition: InlineAsm.h:328
llvm::InlineAsm::isMemKind
static bool isMemKind(unsigned Flag)
Definition: InlineAsm.h:280
llvm::InlineAsm::Constraint_i
@ Constraint_i
Definition: InlineAsm.h:246
llvm::InlineAsm
Definition: InlineAsm.h:31
llvm::InlineAsm::Extra_MayLoad
@ Extra_MayLoad
Definition: InlineAsm.h:226
llvm::InlineAsm::isRegDefEarlyClobberKind
static bool isRegDefEarlyClobberKind(unsigned Flag)
Definition: InlineAsm.h:281
llvm::InlineAsm::canThrow
bool canThrow() const
Definition: InlineAsm.h:71
index
splat index
Definition: README_ALTIVEC.txt:181
llvm::InlineAsm::Op_InputChain
@ Op_InputChain
Definition: InlineAsm.h:211
llvm::InlineAsm::SubConstraintInfo::SubConstraintInfo
SubConstraintInfo()=default
Default constructor.
llvm::InlineAsm::MIOp_ExtraInfo
@ MIOp_ExtraInfo
Definition: InlineAsm.h:219
llvm::InlineAsm::MIOp_AsmString
@ MIOp_AsmString
Definition: InlineAsm.h:218
llvm::InlineAsm::isImmKind
static bool isImmKind(unsigned Flag)
Definition: InlineAsm.h:279
llvm::InlineAsm::ConstraintInfo::isEarlyClobber
bool isEarlyClobber
isEarlyClobber - "&": output operand writes result before inputs are all read.
Definition: InlineAsm.h:127
llvm::PointerType
Class to represent pointers.
Definition: DerivedTypes.h:632
llvm::InlineAsm::ConstraintInfo::ConstraintInfo
ConstraintInfo()=default
Default constructor.
llvm::InlineAsm::ConstraintInfo
Definition: InlineAsm.h:120
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::InlineAsm::ConstraintInfo::Codes
ConstraintCodeVector Codes
Code - The constraint code, either the register name (in braces) or the constraint letter/number.
Definition: InlineAsm.h:151
llvm::InlineAsm::Constraint_Um
@ Constraint_Um
Definition: InlineAsm.h:255
llvm::InlineAsm::MIOp_FirstOperand
@ MIOp_FirstOperand
Definition: InlineAsm.h:220
llvm::InlineAsm::getMemoryConstraintID
static unsigned getMemoryConstraintID(unsigned Flag)
Definition: InlineAsm.h:332
llvm::InlineAsm::SubConstraintInfo::MatchingInput
int MatchingInput
MatchingInput - If this is not -1, this is an output constraint where an input constraint is required...
Definition: InlineAsm.h:106
llvm::InlineAsm::getFlagWordForRegClass
static unsigned getFlagWordForRegClass(unsigned InputFlag, unsigned RC)
getFlagWordForRegClass - Augment an existing flag word returned by getFlagWord with the required regi...
Definition: InlineAsm.h:303
llvm::InlineAsm::SubConstraintInfo::Codes
ConstraintCodeVector Codes
Code - The constraint code, either the register name (in braces) or the constraint letter/number.
Definition: InlineAsm.h:110
llvm::InlineAsm::Constraint_R
@ Constraint_R
Definition: InlineAsm.h:252
llvm::InlineAsm::getConstraintString
const std::string & getConstraintString() const
Definition: InlineAsm.h:84
llvm::InlineAsm::AD_Intel
@ AD_Intel
Definition: InlineAsm.h:35
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::InlineAsm::Kind_RegDef
@ Kind_RegDef
Definition: InlineAsm.h:234
llvm::InlineAsm::getFlagWord
static unsigned getFlagWord(unsigned Kind, unsigned NumOps)
Definition: InlineAsm.h:272
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:134
llvm::Value::getType
Type * getType() const
All values are typed, get the type of this value.
Definition: Value.h:255
uint32_t
llvm::InlineAsm::isClobberKind
static bool isClobberKind(unsigned Flag)
Definition: InlineAsm.h:284
llvm::InlineAsm::Constraints_ShiftAmount
@ Constraints_ShiftAmount
Definition: InlineAsm.h:267
llvm::InlineAsm::getMemConstraintName
static StringRef getMemConstraintName(unsigned Constraint)
Definition: InlineAsm.h:409
llvm::InlineAsm::Extra_IsConvergent
@ Extra_IsConvergent
Definition: InlineAsm.h:228
llvm::InlineAsm::getFlagWordForMem
static unsigned getFlagWordForMem(unsigned InputFlag, unsigned Constraint)
Augment an existing flag word returned by getFlagWord with the constraint code for a memory constrain...
Definition: InlineAsm.h:315
llvm::InlineAsm::getFlagWordForMatchingOp
static unsigned getFlagWordForMatchingOp(unsigned InputFlag, unsigned MatchedOperandNo)
getFlagWordForMatchingOp - Augment an existing flag word returned by getFlagWord with information ind...
Definition: InlineAsm.h:291
llvm::InlineAsm::ConstraintInfo::multipleAlternatives
SubConstraintInfoVector multipleAlternatives
multipleAlternatives - If there are multiple alternative constraints, this array will contain them.
Definition: InlineAsm.h:158
llvm::InlineAsm::ConstraintInfo::selectAlternative
void selectAlternative(unsigned index)
selectAlternative - Point this constraint to the alternative constraint indicated by the index.
Definition: InlineAsm.cpp:207
llvm::InlineAsm::Constraint_m
@ Constraint_m
Definition: InlineAsm.h:247
llvm::InlineAsm::ConstraintInfo::isMultipleAlternative
bool isMultipleAlternative
isMultipleAlternative - '|': has multiple-alternative constraints.
Definition: InlineAsm.h:154
llvm::InlineAsm::Constraint_Ut
@ Constraint_Ut
Definition: InlineAsm.h:259
llvm::InlineAsm::hasRegClassConstraint
static bool hasRegClassConstraint(unsigned Flag, unsigned &RC)
hasRegClassConstraint - Returns true if the flag contains a register class constraint.
Definition: InlineAsm.h:354
llvm::InlineAsm::isClobber
@ isClobber
Definition: InlineAsm.h:96
llvm::InlineAsm::Constraints_Max
@ Constraints_Max
Definition: InlineAsm.h:266
llvm::InlineAsm::Constraint_Unknown
@ Constraint_Unknown
Definition: InlineAsm.h:244
llvm::InlineAsm::getExtraInfoNames
static std::vector< StringRef > getExtraInfoNames(unsigned ExtraInfo)
Definition: InlineAsm.h:366
llvm::InlineAsm::isOutput
@ isOutput
Definition: InlineAsm.h:95
llvm::InlineAsm::ParseConstraints
ConstraintInfoVector ParseConstraints() const
ParseConstraints - Parse the constraints of this inlineasm object, returning them the same way that P...
Definition: InlineAsm.h:183
llvm::InlineAsm::ConstraintPrefix
ConstraintPrefix
Definition: InlineAsm.h:93
llvm::InlineAsm::getNumOperandRegisters
static unsigned getNumOperandRegisters(unsigned Flag)
getNumOperandRegisters - Extract the number of registers field from the inline asm operand flag.
Definition: InlineAsm.h:339
llvm::InlineAsm::Constraint_Uq
@ Constraint_Uq
Definition: InlineAsm.h:257
llvm::InlineAsm::operator=
InlineAsm & operator=(const InlineAsm &)=delete
llvm::InlineAsm::Extra_HasSideEffects
@ Extra_HasSideEffects
Definition: InlineAsm.h:223
llvm::InlineAsm::ConstraintCodeVector
std::vector< std::string > ConstraintCodeVector
Definition: InlineAsm.h:99
llvm::InlineAsm::Op_AsmString
@ Op_AsmString
Definition: InlineAsm.h:212
llvm::InlineAsm::SubConstraintInfoVector
std::vector< SubConstraintInfo > SubConstraintInfoVector
Definition: InlineAsm.h:116
llvm::InlineAsm::SubConstraintInfo
Definition: InlineAsm.h:101
llvm::InlineAsm::Op_MDNode
@ Op_MDNode
Definition: InlineAsm.h:213
Value.h
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::InlineAsm::Extra_MayStore
@ Extra_MayStore
Definition: InlineAsm.h:227
llvm::InlineAsm::Verify
static bool Verify(FunctionType *Ty, StringRef Constraints)
Verify - This static method can be used by the parser to check to see if the specified constraint str...
Definition: InlineAsm.cpp:254
llvm::InlineAsm::ConstraintInfo::hasMatchingInput
bool hasMatchingInput() const
hasMatchingInput - Return true if this is an output constraint that has a matching input constraint.
Definition: InlineAsm.h:137
llvm::FunctionType
Class to represent function types.
Definition: DerivedTypes.h:103
llvm::InlineAsm::Constraint_Uy
@ Constraint_Uy
Definition: InlineAsm.h:261