15#ifndef LLVM_IR_INLINEASM_H
16#define LLVM_IR_INLINEASM_H
35class InlineAsm final :
public Value {
46 std::string AsmString, Constraints;
53 InlineAsm(
FunctionType *Ty,
const std::string &AsmString,
59 void destroyConstant();
200 return V->getValueID() == Value::InlineAsmVal;
369 Idx = getMatchedOperandNo();
382 RC = getRegClass() - 1;
388 "Not expected mem or function flag!");
395 assert(getMatchedOperandNo() == 0 &&
"Matching operand already set");
406 assert(getRegClass() == 0 &&
"Register class already set");
421 "Flag is not a memory or function constraint!");
447 std::vector<StringRef> Result;
449 Result.push_back(
"sideeffect");
451 Result.push_back(
"mayload");
453 Result.push_back(
"maystore");
455 Result.push_back(
"isconvergent");
457 Result.push_back(
"alignstack");
463 Result.push_back(
"attdialect");
465 Result.push_back(
"inteldialect");
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file implements methods to test, set and extract typed bits from packed unsigned integers.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
const size_t AbstractManglingParser< Derived, Alloc >::NumOps
This file defines the SmallVector class.
Lightweight error class with error context and mandatory checking.
Class to represent function types.
void setRegMayBeFolded(bool B)
Set a bit to denote that while this operand is some kind of register (use, def, .....
bool isClobberKind() const
void setRegClass(unsigned RC)
setRegClass - Augment an existing flag with the required register class for the following register op...
StringRef getKindName() const
void clearMemConstraint()
clearMemConstraint - Similar to setMemConstraint(0), but without the assertion checking that the cons...
Flag(enum Kind K, unsigned NumOps)
bool hasRegClassConstraint(unsigned &RC) const
hasRegClassConstraint - Returns true if the flag contains a register class constraint.
bool isRegUseKind() const
void setMatchingOp(unsigned OperandNo)
setMatchingOp - Augment an existing flag with information indicating that this input operand is tied ...
void setMemConstraint(ConstraintCode C)
setMemConstraint - Augment an existing flag with the constraint code for a memory constraint.
ConstraintCode getMemoryConstraintID() const
bool getRegMayBeFolded() const
bool isUseOperandTiedToDef(unsigned &Idx) const
isUseOperandTiedToDef - Return true if the flag of the inline asm operand indicates it is an use oper...
unsigned getNumOperandRegisters() const
getNumOperandRegisters - Extract the number of registers field from the inline asm operand flag.
bool isRegDefEarlyClobberKind() const
bool isRegDefKind() const
LLVM_ABI void collectAsmStrs(SmallVectorImpl< StringRef > &AsmStrs) const
static LLVM_ABI 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.
std::vector< SubConstraintInfo > SubConstraintInfoVector
std::vector< ConstraintInfo > ConstraintInfoVector
static std::vector< StringRef > getExtraInfoNames(unsigned ExtraInfo)
friend struct InlineAsmKeyType
bool isAlignStack() const
AsmDialect getDialect() const
LLVM_ABI FunctionType * getFunctionType() const
getFunctionType - InlineAsm's are always pointers to functions.
bool hasSideEffects() const
StringRef getAsmString() const
InlineAsm(const InlineAsm &)=delete
ConstraintInfoVector ParseConstraints() const
ParseConstraints - Parse the constraints of this inlineasm object, returning them the same way that P...
std::vector< std::string > ConstraintCodeVector
static StringRef getMemConstraintName(ConstraintCode C)
StringRef getConstraintString() const
PointerType * getType() const
getType - InlineAsm's are always pointers.
static bool classof(const Value *V)
InlineAsm & operator=(const InlineAsm &)=delete
Class to represent pointers.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
StringRef - Represent a constant reference to a string, i.e.
Type * getType() const
All values are typed, get the type of this value.
LLVM_ABI Value(Type *Ty, unsigned scid)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
Describes an element of a Bitfield.
static Bitfield::Type get(StorageType Packed)
Unpacks the field from the Packed value.
static void set(StorageType &Packed, typename Bitfield::Type Value)
Sets the typed value in the provided Packed value.
bool isCommutative
isCommutative - This is set to true for a constraint that is commutative with the next operand.
ConstraintPrefix Type
Type - The basic type of the constraint: input/output/clobber/label.
int MatchingInput
MatchingInput - If this is not -1, this is an output constraint where an input constraint is required...
ConstraintCodeVector Codes
Code - The constraint code, either the register name (in braces) or the constraint letter/number.
unsigned currentAlternativeIndex
The currently selected alternative constraint index.
ConstraintInfo()=default
Default constructor.
LLVM_ABI bool Parse(StringRef Str, ConstraintInfoVector &ConstraintsSoFar)
Parse - Analyze the specified string (e.g.
bool hasArg() const
Whether this constraint corresponds to an argument.
SubConstraintInfoVector multipleAlternatives
multipleAlternatives - If there are multiple alternative constraints, this array will contain them.
bool isIndirect
isIndirect - True if this operand is an indirect operand.
bool isEarlyClobber
isEarlyClobber - "&": output operand writes result before inputs are all read.
bool isMultipleAlternative
isMultipleAlternative - '|': has multiple-alternative constraints.
LLVM_ABI void selectAlternative(unsigned index)
selectAlternative - Point this constraint to the alternative constraint indicated by the index.
bool hasMatchingInput() const
hasMatchingInput - Return true if this is an output constraint that has a matching input constraint.
ConstraintCodeVector Codes
Code - The constraint code, either the register name (in braces) or the constraint letter/number.
int MatchingInput
MatchingInput - If this is not -1, this is an output constraint where an input constraint is required...
SubConstraintInfo()=default
Default constructor.