15#ifndef LLVM_IR_INLINEASM_H
16#define LLVM_IR_INLINEASM_H
32template <
class ConstantClass>
class ConstantUniqueMap;
45 std::string AsmString, Constraints;
58 void destroyConstant();
197 return V->getValueID() == Value::InlineAsmVal;
314 unsigned getMatchedOperandNo()
const {
return Bitfield::get<MatchedOperandNo>(Storage); }
315 unsigned getRegClass()
const {
return Bitfield::get<RegClass>(Storage); }
316 bool isMatched()
const {
return Bitfield::get<IsMatched>(Storage); }
322 Bitfield::set<KindField>(Storage, K);
323 Bitfield::set<NumOperands>(Storage, NumOps);
326 Kind getKind()
const {
return Bitfield::get<KindField>(Storage); }
358 return Bitfield::get<NumOperands>(Storage);
366 Idx = getMatchedOperandNo();
379 RC = getRegClass() - 1;
385 "Not expected mem or function flag!");
386 return Bitfield::get<MemConstraintCode>(Storage);
392 assert(getMatchedOperandNo() == 0 &&
"Matching operand already set");
393 Bitfield::set<MatchedOperandNo>(Storage, OperandNo);
394 Bitfield::set<IsMatched>(Storage,
true);
403 assert(getRegClass() == 0 &&
"Register class already set");
405 Bitfield::set<RegClass>(Storage, RC + 1);
412 Bitfield::set<MemConstraintCode>(Storage,
C);
418 "Flag is not a memory or function constraint!");
434 Bitfield::set<RegMayBeFolded>(Storage,
B);
439 return Bitfield::get<RegMayBeFolded>(Storage);
444 std::vector<StringRef> Result;
446 Result.push_back(
"sideeffect");
448 Result.push_back(
"mayload");
450 Result.push_back(
"maystore");
452 Result.push_back(
"isconvergent");
454 Result.push_back(
"alignstack");
460 Result.push_back(
"attdialect");
462 Result.push_back(
"inteldialect");
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
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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
const std::string & getConstraintString() const
void collectAsmStrs(SmallVectorImpl< StringRef > &AsmStrs) const
const std::string & getAsmString() 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.
std::vector< SubConstraintInfo > SubConstraintInfoVector
std::vector< ConstraintInfo > ConstraintInfoVector
static std::vector< StringRef > getExtraInfoNames(unsigned ExtraInfo)
bool isAlignStack() const
AsmDialect getDialect() const
FunctionType * getFunctionType() const
getFunctionType - InlineAsm's are always pointers to functions.
bool hasSideEffects() 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)
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.
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.
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.