15#ifndef LLVM_IR_INLINEASM_H
16#define LLVM_IR_INLINEASM_H
33template <
class ConstantClass>
class ConstantUniqueMap;
46 std::string AsmString, Constraints;
59 void destroyConstant();
200 return V->getValueID() == Value::InlineAsmVal;
317 unsigned getMatchedOperandNo()
const {
return Bitfield::get<MatchedOperandNo>(Storage); }
318 unsigned getRegClass()
const {
return Bitfield::get<RegClass>(Storage); }
319 bool isMatched()
const {
return Bitfield::get<IsMatched>(Storage); }
325 Bitfield::set<KindField>(Storage, K);
326 Bitfield::set<NumOperands>(Storage, NumOps);
329 Kind getKind()
const {
return Bitfield::get<KindField>(Storage); }
361 return Bitfield::get<NumOperands>(Storage);
369 Idx = getMatchedOperandNo();
382 RC = getRegClass() - 1;
388 "Not expected mem or function flag!");
389 return Bitfield::get<MemConstraintCode>(Storage);
395 assert(getMatchedOperandNo() == 0 &&
"Matching operand already set");
396 Bitfield::set<MatchedOperandNo>(Storage, OperandNo);
397 Bitfield::set<IsMatched>(Storage,
true);
406 assert(getRegClass() == 0 &&
"Register class already set");
408 Bitfield::set<RegClass>(Storage, RC + 1);
415 Bitfield::set<MemConstraintCode>(Storage,
C);
421 "Flag is not a memory or function constraint!");
437 Bitfield::set<RegMayBeFolded>(Storage,
B);
442 return Bitfield::get<RegMayBeFolded>(Storage);
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")
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
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)
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.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
#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.
bool isCommutative
isCommutative - This is set to true for a constraint that is commutative with the next operand.
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.