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