16 #ifndef LLVM_IR_INLINEASM_H
17 #define LLVM_IR_INLINEASM_H
42 std::string AsmString, Constraints;
54 void destroyConstant();
187 return V->
getValueID() == Value::InlineAsmVal;
270 assert(((NumOps << 3) & ~0xffff) == 0 &&
"Too many inline asm operands!");
272 return Kind | (NumOps << 3);
289 unsigned MatchedOperandNo) {
290 assert(MatchedOperandNo <= 0x7fff &&
"Too big matched operand");
291 assert((InputFlag & ~0xffff) == 0 &&
"High bits already contain data");
303 assert(!
isImmKind(InputFlag) &&
"Immediates cannot have a register class");
304 assert(!
isMemKind(InputFlag) &&
"Memory operand cannot have a register class");
305 assert(RC <= 0x7fff &&
"Too large register class ID");
306 assert((InputFlag & ~0xffff) == 0 &&
"High bits already contain data");
307 return InputFlag | (RC << 16);
313 assert(
isMemKind(InputFlag) &&
"InputFlag is not a memory constraint!");
314 assert(Constraint <= 0x7fff &&
"Too large a memory constraint ID");
316 assert((InputFlag & ~0xffff) == 0 &&
"High bits already contain data");
337 return (Flag & 0xffff) >> 3;
345 Idx = (Flag & ~Flag_MatchingOperand) >> 16;
354 unsigned High = Flag >> 16;
366 #endif // LLVM_IR_INLINEASM_H
AsmDialect getDialect() const
static unsigned getFlagWord(unsigned Kind, unsigned NumOps)
const std::string & getAsmString() const
static bool isClobberKind(unsigned Flag)
const std::string & getConstraintString() const
bool Parse(StringRef Str, ConstraintInfoVector &ConstraintsSoFar)
Parse - Analyze the specified string (e.g.
static bool isImmKind(unsigned Flag)
static bool isUseOperandTiedToDef(unsigned Flag, unsigned &Idx)
isUseOperandTiedToDef - Return true if the flag of the inline asm operand indicates it is an use oper...
ConstraintCodeVector Codes
Code - The constraint code, either the register name (in braces) or the constraint letter/number...
SubConstraintInfo()=default
Default constructor.
std::vector< std::string > ConstraintCodeVector
static unsigned getFlagWordForRegClass(unsigned InputFlag, unsigned RC)
getFlagWordForRegClass - Augment an existing flag word returned by getFlagWord with the required regi...
bool isCommutative
isCommutative - This is set to true for a constraint that is commutative with the next operand...
ConstraintInfoVector ParseConstraints() const
ParseConstraints - Parse the constraints of this inlineasm object, returning them the same way that P...
static bool isRegDefEarlyClobberKind(unsigned Flag)
static unsigned convertMemFlagWordToMatchingFlagWord(unsigned InputFlag)
Class to represent function types.
signed char MatchingInput
MatchingInput - If this is not -1, this is an output constraint where an input constraint is required...
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...
InlineAsm & operator=(const InlineAsm &)=delete
static bool isRegDefKind(unsigned Flag)
Class to represent pointers.
Flag
These should be considered private to the implementation of the MCInstrDesc class.
bool isEarlyClobber
isEarlyClobber - "&": output operand writes result before inputs are all read.
static bool classof(const Value *V)
bool hasSideEffects() const
The instances of the Type class are immutable: once they are created, they are never changed...
unsigned currentAlternativeIndex
The currently selected alternative constraint index.
bool isIndirect
isIndirect - True if this operand is an indirect operand.
SubConstraintInfoVector multipleAlternatives
multipleAlternatives - If there are multiple alternative constraints, this array will contain them...
PointerType * getType() const
getType - InlineAsm's are always pointers.
static unsigned getNumOperandRegisters(unsigned Flag)
getNumOperandRegisters - Extract the number of registers field from the inline asm operand flag...
static unsigned getMemoryConstraintID(unsigned Flag)
unsigned getValueID() const
Return an ID for the concrete type of this object.
static unsigned getKind(unsigned Flags)
static unsigned getFlagWordForMem(unsigned InputFlag, unsigned Constraint)
Augment an existing flag word returned by getFlagWord with the constraint code for a memory constrain...
static bool isMemKind(unsigned Flag)
std::vector< ConstraintInfo > ConstraintInfoVector
signed char MatchingInput
MatchingInput - If this is not -1, this is an output constraint where an input constraint is required...
FunctionType * getFunctionType() const
getFunctionType - InlineAsm's are always pointers to functions.
ConstraintCodeVector Codes
Code - The constraint code, either the register name (in braces) or the constraint letter/number...
Type * getType() const
All values are typed, get the type of this value.
bool hasMatchingInput() const
hasMatchingInput - Return true if this is an output constraint that has a matching input constraint...
static bool hasRegClassConstraint(unsigned Flag, unsigned &RC)
hasRegClassConstraint - Returns true if the flag contains a register class constraint.
static std::vector< std::string > Flags
ConstraintInfo()=default
Default constructor.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
StringRef - Represent a constant reference to a string, i.e.
std::vector< SubConstraintInfo > SubConstraintInfoVector
bool isAlignStack() const
bool isMultipleAlternative
isMultipleAlternative - '|': has multiple-alternative constraints.
static unsigned getFlagWordForMatchingOp(unsigned InputFlag, unsigned MatchedOperandNo)
getFlagWordForMatchingOp - Augment an existing flag word returned by getFlagWord with information ind...
void selectAlternative(unsigned index)
selectAlternative - Point this constraint to the alternative constraint indicated by the index...