15 #ifndef LLVM_MC_MCINSTRDESC_H
16 #define LLVM_MC_MCINSTRDESC_H
21 #include "llvm/Support/DataTypes.h"
159 (
OpInfo[OpNum].Constraints & (1 << Constraint))) {
160 unsigned Pos = 16 + Constraint * 4;
169 std::string &Info)
const {
539 for (; *ImpUses; ++ImpUses)
540 if (*ImpUses == Reg)
return true;
549 for (; *ImpDefs; ++ImpDefs)
550 if (*ImpDefs == Reg || (
MRI &&
MRI->isSubRegister(Reg, *ImpDefs)))
559 for (
int i = 0, e =
NumDefs; i != e; ++i)
586 if (
OpInfo[i].isPredicate())
bool isIndirectBranch() const
Return true if this is an indirect branch, such as a branch through a register.
unsigned getNumImplicitUses() const
Return the number of implicit uses this instruction has.
const uint16_t * getImplicitDefs() const
bool canFoldAsLoad() const
bool mayAffectControlFlow(const MCInst &MI, const MCRegisterInfo &RI) const
Return true if this is a branch or an instruction which directly writes to the program counter...
bool isCommutable() const
unsigned getFlags() const
Return flags of this instruction.
bool isAsCheapAsAMove() const
unsigned getNumImplicitDefs() const
Return the number of implicit defs this instruct has.
unsigned getNumDefs() const
Return the number of MachineOperands that are register definitions. Register definitions always occur...
uint8_t Flags
Flags - These are flags from the MCOI::OperandFlags enum.
bool hasOptionalDef() const
Set if this instruction has an optional definition, e.g. ARM instructions which can set condition cod...
bool hasImplicitUseOfPhysReg(unsigned Reg) const
Return true if this instruction implicitly uses the specified physical register.
bool isReturn() const
Return true if the instruction is a return.
bool mayStore() const
Return true if this instruction could possibly modify memory. Instructions with this flag set are not...
const uint16_t * getImplicitUses() const
bool isRematerializable() const
bool isVariadic() const
Return true if this instruction can have a variable number of operands. In this case, the variable operands will be after the normal operands but before the implicit definitions and uses (if any are present).
bool isSubRegisterEq(unsigned RegA, unsigned RegB) const
Returns true if RegB is a sub-register of RegA or if RegB == RegA.
bool hasPostISelHook() const
bool isBranch() const
Returns true if this is a conditional, unconditional, or indirect branch. Predicates below can be use...
bool isCall() const
Return true if the instruction is a call.
const uint16_t * ImplicitUses
bool isTerminator() const
Returns true if this instruction part of the terminator for a basic block. Typically this is things l...
bool isBitcast() const
Return true if this instruction is a bitcast instruction.
bool isPredicable() const
Return true if this instruction has a predicate operand that controls execution. It may be set to 'al...
uint8_t OperandType
OperandType - Information about the type of the operand.
unsigned getReg() const
getReg - Returns the register number.
bool hasExtraDefRegAllocReq() const
bool isBarrier() const
Returns true if the specified instruction stops control flow from executing the instruction immediate...
unsigned getProgramCounter() const
Return the register which is the program counter.
bool isUnconditionalBranch() const
Return true if this is a branch which always transfers control flow to some other block...
bool isConvertibleTo3Addr() const
unsigned short NumOperands
int findFirstPredOperandIdx() const
Find the index of the first operand in the operand list that is used to represent the predicate...
bool isOptionalDef() const
unsigned getSize() const
Return the number of bytes in the encoding of this instruction, or zero if the encoding size cannot b...
bool isCompare() const
Return true if this instruction is a comparison.
bool isNotDuplicable() const
Return true if this instruction cannot be safely duplicated. For example, if the instruction has a un...
bool hasDefOfPhysReg(const MCInst &MI, unsigned Reg, const MCRegisterInfo &RI) const
Return true if this instruction defines the specified physical register, either explicitly or implici...
bool isPseudo() const
Return true if this is a pseudo instruction that doesn't correspond to a real machine instruction...
int getOperandConstraint(unsigned OpNum, MCOI::OperandConstraint Constraint) const
Returns the value of the specific constraint if it is set. Returns -1 if it is not set...
unsigned getOpcode() const
Return the opcode number for this descriptor.
uint64_t getFeatureBits() const
bool mayLoad() const
Return true if this instruction could possibly read memory. Instructions with this flag set are not n...
bool usesCustomInsertionHook() const
bool hasImplicitDefOfPhysReg(unsigned Reg, const MCRegisterInfo *MRI=0) const
Return true if this instruction implicitly defines the specified physical register.
bool hasUnmodeledSideEffects() const
unsigned getSchedClass() const
Return the scheduling class for this instruction. The scheduling class is an index into the InstrItin...
OperandType
Operand Type - Operands are tagged with one of the values of this enum.
unsigned getNumOperands() const
bool hasDelaySlot() const
bool isLookupPtrRegClass() const
Currently no other information.
bool getDeprecatedInfo(MCInst &MI, MCSubtargetInfo &STI, std::string &Info) const
Returns true if a certain instruction is deprecated and if so returns the reason in Info...
bool isSelect() const
Return true if this is a select instruction.
const uint16_t * ImplicitDefs
bool(* ComplexDeprecationInfo)(MCInst &, MCSubtargetInfo &, std::string &)
bool isMoveImmediate() const
Return true if this instruction is a move immediate (including conditional moves) instruction...
unsigned getNumOperands() const
Return the number of declared MachineOperands for this MachineInstruction. Note that variadic (isVari...
const MCOperandInfo * OpInfo
uint64_t DeprecatedFeatureMask
const MCRegisterInfo & MRI
bool hasExtraSrcRegAllocReq() const
unsigned short SchedClass
bool isConditionalBranch() const
Return true if this is a branch which may fall through to the next instruction or may transfer contro...
const MCOperand & getOperand(unsigned i) const