Go to the documentation of this file.
15 #ifndef LLVM_IR_INLINEASM_H
16 #define LLVM_IR_INLINEASM_H
42 std::string AsmString, Constraints;
55 void destroyConstant();
194 return V->
getValueID() == Value::InlineAsmVal;
289 assert(((NumOps << 3) & ~0xffff) == 0 &&
"Too many inline asm operands!");
291 return Kind | (NumOps << 3);
308 unsigned MatchedOperandNo) {
309 assert(MatchedOperandNo <= 0x7fff &&
"Too big matched operand");
310 assert((InputFlag & ~0xffff) == 0 &&
"High bits already contain data");
322 assert(!
isImmKind(InputFlag) &&
"Immediates cannot have a register class");
323 assert(!
isMemKind(InputFlag) &&
"Memory operand cannot have a register class");
324 assert(RC <= 0x7fff &&
"Too large register class ID");
325 assert((InputFlag & ~0xffff) == 0 &&
"High bits already contain data");
326 return InputFlag | (RC << 16);
332 assert(
isMemKind(InputFlag) &&
"InputFlag is not a memory constraint!");
333 assert(Constraint <= 0x7fff &&
"Too large a memory constraint ID");
335 assert((InputFlag & ~0xffff) == 0 &&
"High bits already contain data");
356 return (
Flag & 0xffff) >> 3;
383 std::vector<StringRef> Result;
385 Result.push_back(
"sideeffect");
387 Result.push_back(
"mayload");
389 Result.push_back(
"maystore");
391 Result.push_back(
"isconvergent");
393 Result.push_back(
"alignstack");
399 Result.push_back(
"attdialect");
401 Result.push_back(
"inteldialect");
426 switch (Constraint) {
485 #endif // LLVM_IR_INLINEASM_H
int MatchingInput
MatchingInput - If this is not -1, this is an output constraint where an input constraint is required...
This is an optimization pass for GlobalISel generic memory operations.
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)
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
@ Constraints_ShiftAmount
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 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.
static unsigned getKind(unsigned Flags)
static bool isMemKind(unsigned Flag)
static bool isRegDefEarlyClobberKind(unsigned Flag)
bool hasArg() const
Whether this constraint corresponds to an argument.
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)
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
@ Kind_RegDefEarlyClobber
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.