LLVM 20.0.0git
|
Describe properties that are true of each instruction in the target description file. More...
#include "llvm/MC/MCInstrDesc.h"
Public Member Functions | |
int | getOperandConstraint (unsigned OpNum, MCOI::OperandConstraint Constraint) const |
Returns the value of the specified operand constraint if it is present. | |
unsigned | getOpcode () const |
Return the opcode number for this descriptor. | |
unsigned | getNumOperands () const |
Return the number of declared MachineOperands for this MachineInstruction. | |
ArrayRef< MCOperandInfo > | operands () const |
unsigned | getNumDefs () const |
Return the number of MachineOperands that are register definitions. | |
uint64_t | getFlags () const |
Return flags of this instruction. | |
bool | isPreISelOpcode () const |
bool | isVariadic () const |
Return true if this instruction can have a variable number of operands. | |
bool | hasOptionalDef () const |
Set if this instruction has an optional definition, e.g. | |
bool | isPseudo () const |
Return true if this is a pseudo instruction that doesn't correspond to a real machine instruction. | |
bool | isMetaInstruction () const |
Return true if this is a meta instruction that doesn't produce any output in the form of executable instructions. | |
bool | isReturn () const |
Return true if the instruction is a return. | |
bool | isAdd () const |
Return true if the instruction is an add instruction. | |
bool | isTrap () const |
Return true if this instruction is a trap. | |
bool | isMoveReg () const |
Return true if the instruction is a register to register move. | |
bool | isCall () const |
Return true if the instruction is a call. | |
bool | isBarrier () const |
Returns true if the specified instruction stops control flow from executing the instruction immediately following it. | |
bool | isTerminator () const |
Returns true if this instruction part of the terminator for a basic block. | |
bool | isBranch () const |
Returns true if this is a conditional, unconditional, or indirect branch. | |
bool | isIndirectBranch () const |
Return true if this is an indirect branch, such as a branch through a register. | |
bool | isConditionalBranch () const |
Return true if this is a branch which may fall through to the next instruction or may transfer control flow to some other block. | |
bool | isUnconditionalBranch () const |
Return true if this is a branch which always transfers control flow to some other block. | |
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 | isPredicable () const |
Return true if this instruction has a predicate operand that controls execution. | |
bool | isCompare () const |
Return true if this instruction is a comparison. | |
bool | isMoveImmediate () const |
Return true if this instruction is a move immediate (including conditional moves) instruction. | |
bool | isBitcast () const |
Return true if this instruction is a bitcast instruction. | |
bool | isSelect () const |
Return true if this is a select instruction. | |
bool | isNotDuplicable () const |
Return true if this instruction cannot be safely duplicated. | |
bool | hasDelaySlot () const |
Returns true if the specified instruction has a delay slot which must be filled by the code generator. | |
bool | canFoldAsLoad () const |
Return true for instructions that can be folded as memory operands in other instructions. | |
bool | isRegSequenceLike () const |
Return true if this instruction behaves the same way as the generic REG_SEQUENCE instructions. | |
bool | isExtractSubregLike () const |
Return true if this instruction behaves the same way as the generic EXTRACT_SUBREG instructions. | |
bool | isInsertSubregLike () const |
Return true if this instruction behaves the same way as the generic INSERT_SUBREG instructions. | |
bool | isConvergent () const |
Return true if this instruction is convergent. | |
bool | variadicOpsAreDefs () const |
Return true if variadic operands of this instruction are definitions. | |
bool | isAuthenticated () const |
Return true if this instruction authenticates a pointer (e.g. | |
bool | mayLoad () const |
Return true if this instruction could possibly read memory. | |
bool | mayStore () const |
Return true if this instruction could possibly modify memory. | |
bool | mayRaiseFPException () const |
Return true if this instruction may raise a floating-point exception. | |
bool | hasUnmodeledSideEffects () const |
Return true if this instruction has side effects that are not modeled by other flags. | |
bool | isCommutable () const |
Return true if this may be a 2- or 3-address instruction (of the form "X = op Y, Z, ..."), which produces the same result if Y and Z are exchanged. | |
bool | isConvertibleTo3Addr () const |
Return true if this is a 2-address instruction which can be changed into a 3-address instruction if needed. | |
bool | usesCustomInsertionHook () const |
Return true if this instruction requires custom insertion support when the DAG scheduler is inserting it into a machine basic block. | |
bool | hasPostISelHook () const |
Return true if this instruction requires adjustment after instruction selection by calling a target hook. | |
bool | isRematerializable () const |
Returns true if this instruction is a candidate for remat. | |
bool | isAsCheapAsAMove () const |
Returns true if this instruction has the same cost (or less) than a move instruction. | |
bool | hasExtraSrcRegAllocReq () const |
Returns true if this instruction source operands have special register allocation requirements that are not captured by the operand register classes. | |
bool | hasExtraDefRegAllocReq () const |
Returns true if this instruction def operands have special register allocation requirements that are not captured by the operand register classes. | |
ArrayRef< MCPhysReg > | implicit_uses () const |
Return a list of registers that are potentially read by any instance of this machine instruction. | |
ArrayRef< MCPhysReg > | implicit_defs () const |
Return a list of registers that are potentially written by any instance of this machine instruction. | |
bool | hasImplicitUseOfPhysReg (MCRegister Reg) const |
Return true if this instruction implicitly uses the specified physical register. | |
bool | hasImplicitDefOfPhysReg (MCRegister Reg, const MCRegisterInfo *MRI=nullptr) const |
Return true if this instruction implicitly defines the specified physical register. | |
unsigned | getSchedClass () const |
Return the scheduling class for this instruction. | |
unsigned | getSize () const |
Return the number of bytes in the encoding of this instruction, or zero if the encoding size cannot be known from the opcode. | |
int | findFirstPredOperandIdx () const |
Find the index of the first operand in the operand list that is used to represent the predicate. | |
bool | hasDefOfPhysReg (const MCInst &MI, MCRegister Reg, const MCRegisterInfo &RI) const |
Return true if this instruction defines the specified physical register, either explicitly or implicitly. | |
Public Attributes | |
unsigned short | Opcode |
unsigned short | NumOperands |
unsigned char | NumDefs |
unsigned char | Size |
unsigned short | SchedClass |
unsigned char | NumImplicitUses |
unsigned char | NumImplicitDefs |
unsigned short | ImplicitOffset |
unsigned short | OpInfoOffset |
uint64_t | Flags |
uint64_t | TSFlags |
Describe properties that are true of each instruction in the target description file.
This captures information about side effects, register use and many other things. There is one instance of this struct for each target instruction class, and the MachineInstr class points to this struct directly to describe itself.
Definition at line 198 of file MCInstrDesc.h.
|
inline |
Return true for instructions that can be folded as memory operands in other instructions.
The most common use for this is instructions that are simple loads from memory that don't modify the loaded value in any way, but it can also be used for instructions that can be expressed as constant-pool loads, such as V_SETALLONES on x86, to allow them to be folded when it is beneficial. This should only be set on instructions that return a value in their only virtual register definition.
Definition at line 369 of file MCInstrDesc.h.
References Flags, and llvm::MCID::FoldableAsLoad.
|
inline |
Find the index of the first operand in the operand list that is used to represent the predicate.
It returns -1 if none is found.
Definition at line 609 of file MCInstrDesc.h.
References getNumOperands(), isPredicable(), and operands().
|
inline |
Return flags of this instruction.
Definition at line 251 of file MCInstrDesc.h.
References Flags.
Referenced by llvm::MachineInstr::hasProperty().
|
inline |
Return the number of MachineOperands that are register definitions.
Register definitions always occur at the start of the machine operand list. This is the number of "outs" in the .td file, and does not include implicit defs.
Definition at line 248 of file MCInstrDesc.h.
References NumDefs.
Referenced by llvm::SIInstrInfo::buildShrunkInst(), llvm::TargetInstrInfo::commuteInstructionImpl(), llvm::AMDGPU::VOPD::ComponentProps::ComponentProps(), llvm::ScheduleDAGSDNodes::computeOperandLatency(), llvm::TargetInstrInfo::findCommutedOpIndices(), llvm::X86::getCondFromMI(), llvm::X86::getCondSrcNoFromDesc(), llvm::MachineInstr::getNumExplicitDefs(), getPhysicalRegisterVT(), llvm::ARMTargetLowering::getSchedulingPreference(), hasType(), llvm::ResourcePriorityQueue::initNumRegDefsLeft(), llvm::HexagonInstrInfo::isDependent(), oneUseDominatesOtherUses(), llvm::WebAssemblyInstPrinter::printOperand(), llvm::X86InstrInfo::unfoldMemoryOperand(), and llvm::mca::verifyOperands().
|
inline |
Return the number of declared MachineOperands for this MachineInstruction.
Note that variadic (isVariadic() returns true) instructions may have additional operands at the end of the list, and note that the machine instruction may include implicit register def/uses as well.
Definition at line 237 of file MCInstrDesc.h.
References NumOperands.
Referenced by llvm::ScheduleDAGInstrs::addPhysRegDataDeps(), llvm::ARMTargetLowering::AdjustInstrPostInstrSelection(), llvm::AMDGPU::VOPD::ComponentProps::ComponentProps(), llvm::ARMBaseInstrInfo::convertToThreeAddress(), llvm::PPCInstrInfo::copyPhysReg(), llvm::SIInstrInfo::expandPostRAPseudo(), findFirstPredOperandIdx(), llvm::findFirstVPTPredOperandIdx(), llvm::ARMBaseInstrInfo::foldImmediate(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::X86::getCondSrcNoFromDesc(), llvm::MachineInstr::getNumExplicitOperands(), llvm::TargetInstrInfo::getRegClass(), llvm::SIInstrInfo::getRegClass(), getTargetMBB(), hasType(), lowerRISCVVMachineInstrToMCInst(), needsExpandMemInst(), llvm::PPCInstrInfo::onlyFoldImmediate(), llvm::LanaiInstrInfo::optimizeSelect(), llvm::ARMBaseInstrInfo::optimizeSelect(), llvm::RISCVInstrInfo::optimizeSelect(), llvm::SPIRVInstPrinter::printInst(), llvm::SPIRVInstPrinter::printOpDecorate(), llvm::SPIRVInstPrinter::printOpExtInst(), llvm::FastISel::selectStackmap(), tryChangeVGPRtoSGPRinCopy(), llvm::SystemZInstrInfo::verifyInstruction(), and llvm::mca::verifyOperands().
|
inline |
Return the opcode number for this descriptor.
Definition at line 230 of file MCInstrDesc.h.
References Opcode.
Referenced by adjustDefLatency(), llvm::AVRInstrInfo::analyzeBranch(), copyPhysSubRegs(), llvm::ARM_MC::evaluateBranchTarget(), llvm::X86::getCondSrcNoFromDesc(), llvm::ARMBaseInstrInfo::getOperandLatency(), llvm::AMDGPU::hasAny64BitVGPROperands(), hasRAWHazard(), and llvm::HexagonShuffler::shuffle().
|
inline |
Returns the value of the specified operand constraint if it is present.
Returns -1 if it is not present.
Definition at line 219 of file MCInstrDesc.h.
References NumOperands, and operands().
Referenced by llvm::MachineInstr::addOperand(), llvm::ARMTargetLowering::AdjustInstrPostInstrSelection(), llvm::AMDGPU::VOPD::ComponentProps::ComponentProps(), llvm::MachineInstr::hasComplexRegisterTies(), and lowerRISCVVMachineInstrToMCInst().
|
inline |
Return the scheduling class for this instruction.
The scheduling class is an index into the InstrItineraryData table. This returns zero if there is no known scheduling information for the instruction.
Definition at line 600 of file MCInstrDesc.h.
References SchedClass.
Referenced by llvm::DFAPacketizer::canReserveResources(), llvm::MCSchedModel::computeInstrLatency(), llvm::TargetSchedModel::computeInstrLatency(), llvm::TargetSchedModel::computeOperandLatency(), llvm::TargetSchedModel::computeReciprocalThroughput(), llvm::ScoreboardHazardRecognizer::EmitInstruction(), llvm::HexagonInstrInfo::genAllInsnTimingClasses(), llvm::HexagonMCInstrInfo::getCVIResources(), llvm::ScoreboardHazardRecognizer::getHazardType(), llvm::TargetInstrInfo::getInstrLatency(), llvm::TargetInstrInfo::getOperandLatency(), llvm::ARMBaseInstrInfo::getOperandLatency(), llvm::HexagonMCInstrInfo::getOtherReservedSlots(), llvm::MCSchedModel::getReciprocalThroughput(), llvm::mca::InstrumentManager::getSchedClassID(), llvm::mca::RISCVInstrumentManager::getSchedClassID(), llvm::ARMTargetLowering::getSchedulingPreference(), llvm::HexagonMCInstrInfo::getUnits(), llvm::HexagonPacketizerList::ignorePseudoInstruction(), and llvm::DFAPacketizer::reserveResources().
|
inline |
Return the number of bytes in the encoding of this instruction, or zero if the encoding size cannot be known from the opcode.
Definition at line 604 of file MCInstrDesc.h.
References Size.
Referenced by llvm::ARMBaseInstrInfo::getInstSizeInBytes().
bool MCInstrDesc::hasDefOfPhysReg | ( | const MCInst & | MI, |
MCRegister | Reg, | ||
const MCRegisterInfo & | RI | ||
) | const |
Return true if this instruction defines the specified physical register, either explicitly or implicitly.
Definition at line 40 of file MCInstrDesc.cpp.
References hasImplicitDefOfPhysReg(), llvm::MCRegisterInfo::isSubRegisterEq(), MI, NumDefs, NumOperands, and variadicOpsAreDefs().
Referenced by llvm::MCInstrAnalysis::mayAffectControlFlow(), and mayAffectControlFlow().
|
inline |
Returns true if the specified instruction has a delay slot which must be filled by the code generator.
Definition at line 360 of file MCInstrDesc.h.
References llvm::MCID::DelaySlot, and Flags.
|
inline |
Returns true if this instruction def operands have special register allocation requirements that are not captured by the operand register classes.
e.g. ARM::LDRD's two def registers must be an even / odd pair, ARM::LDM registers have to be in ascending order. Post-register allocation passes should not attempt to change allocations for definitions of instructions with this flag.
Definition at line 555 of file MCInstrDesc.h.
References llvm::MCID::ExtraDefRegAllocReq, and Flags.
|
inline |
Returns true if this instruction source operands have special register allocation requirements that are not captured by the operand register classes.
e.g. ARM::STRD's two source registers must be an even / odd pair, ARM::STM registers have to be in ascending order. Post-register allocation passes should not attempt to change allocations for sources of instructions with this flag.
Definition at line 545 of file MCInstrDesc.h.
References llvm::MCID::ExtraSrcRegAllocReq, and Flags.
bool MCInstrDesc::hasImplicitDefOfPhysReg | ( | MCRegister | Reg, |
const MCRegisterInfo * | MRI = nullptr |
||
) | const |
Return true if this instruction implicitly defines the specified physical register.
Definition at line 32 of file MCInstrDesc.cpp.
References implicit_defs(), and MRI.
Referenced by llvm::ScheduleDAGInstrs::addPhysRegDataDeps(), and hasDefOfPhysReg().
|
inline |
Return true if this instruction implicitly uses the specified physical register.
Definition at line 587 of file MCInstrDesc.h.
References implicit_uses(), llvm::is_contained(), and Reg.
Referenced by llvm::ScheduleDAGInstrs::addPhysRegDataDeps().
|
inline |
Set if this instruction has an optional definition, e.g.
ARM instructions which can set condition code if 's' bit is set.
Definition at line 265 of file MCInstrDesc.h.
References Flags, and llvm::MCID::HasOptionalDef.
Referenced by llvm::ARMBaseInstrInfo::foldImmediate(), and llvm::mca::verifyOperands().
|
inline |
Return true if this instruction requires adjustment after instruction selection by calling a target hook.
For example, this can be used to fill in ARM 's' optional operand depending on whether the conditional flag register is used.
Definition at line 517 of file MCInstrDesc.h.
References Flags, and llvm::MCID::HasPostISelHook.
|
inline |
Return true if this instruction has side effects that are not modeled by other flags.
This does not return true for instructions whose effects are captured by:
Examples of side effects would be modifying 'invisible' machine state like a control register, flushing a cache, modifying a register invisible to LLVM, etc.
Definition at line 463 of file MCInstrDesc.h.
References Flags, and llvm::MCID::UnmodeledSideEffects.
Referenced by llvm::mca::InstrBuilder::createInstruction().
Return a list of registers that are potentially written by any instance of this machine instruction.
For example, on X86, many instructions implicitly set the flags register. In this case, they are marked as setting the FLAGS. Likewise, many instructions always deposit their result in a physical register. For example, the X86 divide instruction always deposits the quotient and remainder in the EAX/EDX registers. For that instruction, this will return a list containing the EAX/EDX/EFLAGS registers.
Definition at line 579 of file MCInstrDesc.h.
References ImplicitOffset, NumImplicitDefs, NumImplicitUses, and Opcode.
Referenced by llvm::MachineInstr::addImplicitDefUseOperands(), llvm::MachineInstr::getNumDefs(), getPhysicalRegisterVT(), HasImplicitCPSRDef(), hasImplicitDefOfPhysReg(), and llvm::PPCInstrInfo::optimizeCompareInstr().
Return a list of registers that are potentially read by any instance of this machine instruction.
For example, on X86, the "adc" instruction adds two register operands and adds the carry bit in from the flags register. In this case, the instruction is marked as implicitly reading the flags. Likewise, the variable shift instruction on X86 is marked as implicitly reading the 'CL' register, which it always does.
Definition at line 565 of file MCInstrDesc.h.
References ImplicitOffset, NumImplicitUses, and Opcode.
Referenced by llvm::MachineInstr::addImplicitDefUseOperands(), llvm::SIInstrInfo::expandPostRAPseudo(), hasImplicitUseOfPhysReg(), and llvm::PPCInstrInfo::optimizeCompareInstr().
|
inline |
Return true if the instruction is an add instruction.
Definition at line 279 of file MCInstrDesc.h.
References llvm::MCID::Add, and Flags.
|
inline |
Returns true if this instruction has the same cost (or less) than a move instruction.
This is useful during certain types of optimizations (e.g., remat during two-address conversion or machine licm) where we would like to remat or hoist the instruction, but not if it costs more than moving the instruction into the appropriate register. Note, we are not marking copies from and to the same register class with this flag.
This method could be called by interface TargetInstrInfo::isAsCheapAsAMove for different subtargets.
Definition at line 537 of file MCInstrDesc.h.
References llvm::MCID::CheapAsAMove, and Flags.
|
inline |
Return true if this instruction authenticates a pointer (e.g.
LDRAx/BRAx from ARMv8.3, which perform loads/branches with authentication).
An authenticated instruction may fail in an ABI-defined manner when operating on an invalid signed pointer.
Definition at line 427 of file MCInstrDesc.h.
References llvm::MCID::Authenticated, and Flags.
|
inline |
Returns true if the specified instruction stops control flow from executing the instruction immediately following it.
Examples include unconditional branches and return instructions.
Definition at line 293 of file MCInstrDesc.h.
References llvm::MCID::Barrier, and Flags.
Referenced by isConditionalBranch(), and isUnconditionalBranch().
|
inline |
Return true if this instruction is a bitcast instruction.
Definition at line 348 of file MCInstrDesc.h.
References llvm::MCID::Bitcast, and Flags.
|
inline |
Returns true if this is a conditional, unconditional, or indirect branch.
Predicates below can be used to discriminate between these cases, and the TargetInstrInfo::analyzeBranch method can be used to get more information.
Definition at line 307 of file MCInstrDesc.h.
References llvm::MCID::Branch, and Flags.
Referenced by llvm::PPCDispatchGroupSBHazardRecognizer::EmitInstruction(), llvm::MCInstrAnalysis::isBranch(), isConditionalBranch(), isUnconditionalBranch(), and mayAffectControlFlow().
|
inline |
Return true if the instruction is a call.
Definition at line 288 of file MCInstrDesc.h.
References llvm::MCID::Call, and Flags.
Referenced by llvm::mca::computeMaxLatency(), llvm::MCInstrAnalysis::isCall(), llvm::PPCMCCodeEmitter::isNoTOCCallInstr(), mayAffectControlFlow(), llvm::SelectionDAGISel::runOnMachineFunction(), and llvm::ResourcePriorityQueue::SUSchedulingCost().
|
inline |
Return true if this may be a 2- or 3-address instruction (of the form "X = op Y, Z, ..."), which produces the same result if Y and Z are exchanged.
If this flag is set, then the TargetInstrInfo::commuteInstruction method may be used to hack on the instruction.
Note that this flag may be set on instructions that are only commutable sometimes. In these cases, the call to commuteInstruction will fail. Also note that some instructions require non-trivial modification to commute them.
Definition at line 481 of file MCInstrDesc.h.
References llvm::MCID::Commutable, and Flags.
Referenced by llvm::TargetInstrInfo::findCommutedOpIndices(), and llvm::MipsInstrInfo::findCommutedOpIndices().
|
inline |
Return true if this instruction is a comparison.
Definition at line 341 of file MCInstrDesc.h.
References llvm::MCID::Compare, and Flags.
|
inline |
Return true if this is a branch which may fall through to the next instruction or may transfer control flow to some other block.
The TargetInstrInfo::analyzeBranch method can be used to get more information about this branch.
Definition at line 317 of file MCInstrDesc.h.
References isBarrier(), isBranch(), and isIndirectBranch().
Referenced by llvm::MCInstrAnalysis::isConditionalBranch(), and parseCondBranch().
|
inline |
Return true if this instruction is convergent.
Convergent instructions may not be made control-dependent on any additional values.
Definition at line 415 of file MCInstrDesc.h.
References llvm::MCID::Convergent, and Flags.
|
inline |
Return true if this is a 2-address instruction which can be changed into a 3-address instruction if needed.
Doing this transformation can be profitable in the register allocator, because it means that the instruction can use a 2-address form if possible, but degrade into a less efficient form if the source and dest register cannot be assigned to the same register. For example, this allows the x86 backend to turn a "shl reg, 3" instruction into an LEA instruction, which is the same speed as the shift but has bigger code size.
If this returns true, then the target must implement the TargetInstrInfo::convertToThreeAddress method for this instruction, which is allowed to fail if the transformation isn't valid for this specific instruction (e.g. shl reg, 4 on x86).
Definition at line 497 of file MCInstrDesc.h.
References llvm::MCID::ConvertibleTo3Addr, and Flags.
|
inline |
Return true if this instruction behaves the same way as the generic EXTRACT_SUBREG instructions.
E.g., on ARM, rX, rY VMOVRRD dZ is equivalent to two EXTRACT_SUBREG: rX = EXTRACT_SUBREG dZ, ssub_0 rY = EXTRACT_SUBREG dZ, ssub_1
Note that for the optimizers to be able to take advantage of this property, TargetInstrInfo::getExtractSubregLikeInputs has to be override accordingly.
Definition at line 394 of file MCInstrDesc.h.
References llvm::MCID::ExtractSubreg, and Flags.
|
inline |
Return true if this is an indirect branch, such as a branch through a register.
Definition at line 311 of file MCInstrDesc.h.
References Flags, and llvm::MCID::IndirectBranch.
Referenced by isConditionalBranch(), llvm::MCInstrAnalysis::isIndirectBranch(), isUnconditionalBranch(), and mayAffectControlFlow().
|
inline |
Return true if this instruction behaves the same way as the generic INSERT_SUBREG instructions.
E.g., on ARM, dX = VSETLNi32 dY, rZ, Imm is equivalent to a INSERT_SUBREG: dX = INSERT_SUBREG dY, rZ, translateImmToSubIdx(Imm)
Note that for the optimizers to be able to take advantage of this property, TargetInstrInfo::getInsertSubregLikeInputs has to be override accordingly.
Definition at line 408 of file MCInstrDesc.h.
References Flags, and llvm::MCID::InsertSubreg.
|
inline |
Return true if this is a meta instruction that doesn't produce any output in the form of executable instructions.
Definition at line 273 of file MCInstrDesc.h.
References Flags, and llvm::MCID::Meta.
|
inline |
Return true if this instruction is a move immediate (including conditional moves) instruction.
Definition at line 345 of file MCInstrDesc.h.
References Flags, and llvm::MCID::MoveImm.
|
inline |
Return true if the instruction is a register to register move.
Definition at line 285 of file MCInstrDesc.h.
References Flags, and llvm::MCID::MoveReg.
|
inline |
Return true if this instruction cannot be safely duplicated.
For example, if the instruction has a unique labels attached to it, duplicating it would cause multiple definition errors.
Definition at line 356 of file MCInstrDesc.h.
References Flags, and llvm::MCID::NotDuplicable.
|
inline |
Return true if this instruction has a predicate operand that controls execution.
It may be set to 'always', or may be set to other values. There are various methods in TargetInstrInfo that can be used to control and modify the predicate in this instruction.
Definition at line 338 of file MCInstrDesc.h.
References Flags, and llvm::MCID::Predicable.
Referenced by DecodePredicateOperand(), llvm::MachineInstr::findFirstPredOperandIdx(), and findFirstPredOperandIdx().
|
inline |
Definition at line 255 of file MCInstrDesc.h.
References Flags, and llvm::MCID::PreISelOpcode.
|
inline |
Return true if this is a pseudo instruction that doesn't correspond to a real machine instruction.
Definition at line 269 of file MCInstrDesc.h.
References Flags, and llvm::MCID::Pseudo.
Referenced by llvm::HexagonMCInstrInfo::isCanon(), and llvm::PPCInstrInfo::onlyFoldImmediate().
|
inline |
Return true if this instruction behaves the same way as the generic REG_SEQUENCE instructions.
E.g., on ARM, dX VMOVDRR rY, rZ is equivalent to dX = REG_SEQUENCE rY, ssub_0, rZ, ssub_1.
Note that for the optimizers to be able to take advantage of this property, TargetInstrInfo::getRegSequenceLikeInputs has to be override accordingly.
Definition at line 381 of file MCInstrDesc.h.
References Flags, and llvm::MCID::RegSequence.
|
inline |
Returns true if this instruction is a candidate for remat.
This flag is only used in TargetInstrInfo method isTriviallyRematerializable.
If this flag is set, the isReallyTriviallyReMaterializable() method is called to verify the instruction is really rematerializable.
Definition at line 524 of file MCInstrDesc.h.
References Flags, and llvm::MCID::Rematerializable.
|
inline |
Return true if the instruction is a return.
Definition at line 276 of file MCInstrDesc.h.
References Flags, and llvm::MCID::Return.
Referenced by llvm::MCInstrAnalysis::isReturn(), mayAffectControlFlow(), and llvm::SelectionDAGISel::runOnMachineFunction().
|
inline |
Return true if this is a select instruction.
Definition at line 351 of file MCInstrDesc.h.
References Flags, and llvm::MCID::Select.
|
inline |
Returns true if this instruction part of the terminator for a basic block.
Typically this is things like return and branch instructions.
Various passes use this to insert code into the bottom of a basic block, but before control flow occurs.
Definition at line 301 of file MCInstrDesc.h.
References Flags, and llvm::MCID::Terminator.
Referenced by llvm::MCInstrAnalysis::isTerminator().
|
inline |
Return true if this instruction is a trap.
Definition at line 282 of file MCInstrDesc.h.
References Flags, and llvm::MCID::Trap.
|
inline |
Return true if this is a branch which always transfers control flow to some other block.
The TargetInstrInfo::analyzeBranch method can be used to get more information about this branch.
Definition at line 325 of file MCInstrDesc.h.
References isBarrier(), isBranch(), and isIndirectBranch().
Referenced by llvm::MCInstrAnalysis::isUnconditionalBranch().
|
inline |
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).
Definition at line 261 of file MCInstrDesc.h.
References Flags, and llvm::MCID::Variadic.
Referenced by llvm::MachineInstr::getNumExplicitDefs(), llvm::MachineInstr::getNumExplicitOperands(), and llvm::SPIRVInstPrinter::printInst().
bool MCInstrDesc::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.
Considered 'may' affect rather than 'does' affect as things like predication are not taken into account.
Definition at line 20 of file MCInstrDesc.cpp.
References llvm::MCRegisterInfo::getProgramCounter(), hasDefOfPhysReg(), isBranch(), isCall(), isIndirectBranch(), isReturn(), and MI.
|
inline |
Return true if this instruction could possibly read memory.
Instructions with this flag set are not necessarily simple load instructions, they may load a value and modify it, for example.
Definition at line 438 of file MCInstrDesc.h.
References Flags, and llvm::MCID::MayLoad.
Referenced by llvm::addFrameReference(), addFrameReference(), llvm::M68k::addFrameReference(), llvm::M68k::addMemOperand(), adjustAllocatableRegClass(), llvm::mca::InstrBuilder::createInstruction(), llvm::ARMBaseInstrInfo::getOperandLatency(), llvm::HexagonShuffler::restrictStoreLoadOrder(), and llvm::SelectionDAGISel::SelectCodeCommon().
|
inline |
Return true if this instruction may raise a floating-point exception.
Definition at line 447 of file MCInstrDesc.h.
References Flags, and llvm::MCID::MayRaiseFPException.
Referenced by llvm::SelectionDAGISel::mayRaiseFPException().
|
inline |
Return true if this instruction could possibly modify memory.
Instructions with this flag set are not necessarily simple store instructions, they may store a modified value based on their operands, or may not actually modify anything, for example.
Definition at line 444 of file MCInstrDesc.h.
References Flags, and llvm::MCID::MayStore.
Referenced by llvm::addFrameReference(), addFrameReference(), llvm::M68k::addFrameReference(), llvm::M68k::addMemOperand(), adjustAllocatableRegClass(), llvm::mca::InstrBuilder::createInstruction(), and llvm::SelectionDAGISel::SelectCodeCommon().
|
inline |
Definition at line 239 of file MCInstrDesc.h.
References NumOperands, Opcode, and OpInfoOffset.
Referenced by llvm::ARMTargetLowering::AdjustInstrPostInstrSelection(), llvm::AMDGPU::VOPD::ComponentProps::ComponentProps(), llvm::TargetSchedModel::computeOperandLatency(), llvm::X86_MC::X86MCInstrAnalysis::evaluateBranch(), llvm::MachineInstr::findFirstPredOperandIdx(), findFirstPredOperandIdx(), findFirstVectorPredOperandIdx(), llvm::findFirstVPTPredOperandIdx(), llvm::SIInstrInfo::foldImmediate(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), getOperandConstraint(), llvm::TargetInstrInfo::getRegClass(), llvm::SIInstrInfo::getRegClass(), llvm::MachineInstr::getTypeToPrint(), llvm::AMDGPU::hasAny64BitVGPROperands(), hasType(), llvm::SIInstrInfo::isImmOperandLegal(), llvm::SIInstrInfo::isOperandLegal(), llvm::SIInstrInfo::legalizeOperandsVOP2(), lowerRISCVVMachineInstrToMCInst(), needsExpandMemInst(), llvm::PPCInstrInfo::onlyFoldImmediate(), llvm::LanaiInstrInfo::optimizeSelect(), llvm::ARMBaseInstrInfo::optimizeSelect(), llvm::TargetInstrInfo::PredicateInstruction(), llvm::ARMBaseInstrInfo::PredicateInstruction(), llvm::SPIRVInstPrinter::printInst(), llvm::PPCInstrInfo::promoteInstr32To64ForElimEXTSW(), llvm::LegalizerInfo::verify(), and llvm::SystemZInstrInfo::verifyInstruction().
|
inline |
Return true if this instruction requires custom insertion support when the DAG scheduler is inserting it into a machine basic block.
If this is true for the instruction, it basically means that it is a pseudo instruction used at SelectionDAG time that is expanded out into magic code by the target when MachineInstrs are formed.
If this is true, the TargetLoweringInfo::InsertAtEndOfBasicBlock method is used to insert this into the MachineBasicBlock.
Definition at line 509 of file MCInstrDesc.h.
References Flags, and llvm::MCID::UsesCustomInserter.
|
inline |
Return true if variadic operands of this instruction are definitions.
Definition at line 418 of file MCInstrDesc.h.
References Flags, and llvm::MCID::VariadicOpsAreDefs.
Referenced by hasDefOfPhysReg().
uint64_t llvm::MCInstrDesc::Flags |
Definition at line 214 of file MCInstrDesc.h.
Referenced by canFoldAsLoad(), getFlags(), hasDelaySlot(), hasExtraDefRegAllocReq(), hasExtraSrcRegAllocReq(), hasOptionalDef(), hasPostISelHook(), hasUnmodeledSideEffects(), isAdd(), isAsCheapAsAMove(), isAuthenticated(), isBarrier(), isBitcast(), isBranch(), isCall(), isCommutable(), isCompare(), isConvergent(), isConvertibleTo3Addr(), isExtractSubregLike(), isIndirectBranch(), isInsertSubregLike(), isMetaInstruction(), isMoveImmediate(), isMoveReg(), isNotDuplicable(), isPredicable(), isPreISelOpcode(), isPseudo(), isRegSequenceLike(), isRematerializable(), isReturn(), isSelect(), isTerminator(), isTrap(), isVariadic(), mayLoad(), mayRaiseFPException(), mayStore(), usesCustomInsertionHook(), and variadicOpsAreDefs().
unsigned short llvm::MCInstrDesc::ImplicitOffset |
Definition at line 212 of file MCInstrDesc.h.
Referenced by implicit_defs(), and implicit_uses().
Definition at line 207 of file MCInstrDesc.h.
Referenced by getNumDefs(), hasDefOfPhysReg(), and llvm::X86InstrInfo::unfoldMemoryOperand().
Definition at line 211 of file MCInstrDesc.h.
Referenced by implicit_defs().
Definition at line 210 of file MCInstrDesc.h.
Referenced by implicit_defs(), and implicit_uses().
unsigned short llvm::MCInstrDesc::NumOperands |
Definition at line 206 of file MCInstrDesc.h.
Referenced by findFirstVectorPredOperandIdx(), getNumOperands(), getOperandConstraint(), hasDefOfPhysReg(), and operands().
unsigned short llvm::MCInstrDesc::Opcode |
Definition at line 205 of file MCInstrDesc.h.
Referenced by llvm::BuildMI(), llvm::ScoreboardHazardRecognizer::EmitInstruction(), getOpcode(), llvm::ARMBaseInstrInfo::getOperandLatency(), llvm::SIInstrInfo::getRegClass(), llvm::MachineInstr::hasComplexRegisterTies(), implicit_defs(), implicit_uses(), operands(), and llvm::MachineInstr::setDesc().
unsigned short llvm::MCInstrDesc::OpInfoOffset |
Definition at line 213 of file MCInstrDesc.h.
Referenced by operands().
unsigned short llvm::MCInstrDesc::SchedClass |
Definition at line 209 of file MCInstrDesc.h.
Referenced by getSchedClass().
Definition at line 208 of file MCInstrDesc.h.
Referenced by getSize().
uint64_t llvm::MCInstrDesc::TSFlags |
Definition at line 215 of file MCInstrDesc.h.
Referenced by adjustAllocatableRegClass(), llvm::ARMBaseInstrInfo::ClobbersPredicate(), CompressEVEXImpl(), createPostIncLoadStore(), llvm::ARM_MC::evaluateBranchTarget(), llvm::X86_MC::X86MCInstrAnalysis::evaluateMemoryOperandAddress(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), llvm::HexagonMCInstrInfo::getAddrMode(), getAddrOffset(), llvm::HexagonMCInstrInfo::getExtendableOp(), llvm::HexagonMCInstrInfo::getExtentAlignment(), llvm::HexagonMCInstrInfo::getExtentBits(), llvm::ARMHazardRecognizerFPMLx::getHazardType(), llvm::HexagonMCInstrInfo::getMemAccessSize(), llvm::X86_MC::X86MCInstrAnalysis::getMemoryOperandRelocationOffset(), llvm::HexagonMCInstrInfo::getNewValueOp(), llvm::HexagonMCInstrInfo::getNewValueOp2(), llvm::SystemZInstrInfo::getOpcodeForOffset(), llvm::ARMBaseInstrInfo::getOutliningTypeImpl(), llvm::SIInstrInfo::getRegClass(), llvm::HexagonMCInstrInfo::getType(), getVecSize(), llvm::SystemZInstrInfo::hasDisplacementPairInsn(), llvm::HexagonMCInstrInfo::hasHvxTmp(), llvm::HexagonMCInstrInfo::hasNewValue(), llvm::HexagonMCInstrInfo::hasNewValue2(), hasRAWHazard(), llvm::HexagonMCInstrInfo::isAccumulator(), llvm::HexagonMCInstrInfo::isCofMax1(), llvm::HexagonMCInstrInfo::isCofRelax1(), llvm::HexagonMCInstrInfo::isCofRelax2(), llvm::HexagonMCInstrInfo::isCVINew(), llvm::HexagonInstrInfo::isExtendable(), llvm::HexagonMCInstrInfo::isExtendable(), llvm::HexagonMCInstrInfo::isExtended(), llvm::HexagonMCInstrInfo::isExtentSigned(), llvm::HexagonMCInstrInfo::isFloat(), isHorizontalReduction(), llvm::isMVEVectorInstruction(), llvm::HexagonMCInstrInfo::isNewValue(), llvm::HexagonMCInstrInfo::isNewValueStore(), llvm::ARCInstrInfo::isPostIncrement(), llvm::HexagonMCInstrInfo::isPredicated(), llvm::HexagonMCInstrInfo::isPredicatedNew(), llvm::HexagonMCInstrInfo::isPredicatedTrue(), llvm::HexagonMCInstrInfo::isPredicateLate(), isPrefix(), llvm::PPCMCCodeEmitter::isPrefixedInstruction(), llvm::ARCInstrInfo::isPreIncrement(), llvm::HexagonMCInstrInfo::isRestrictNoSlot1Store(), llvm::HexagonMCInstrInfo::isRestrictSlot1AOK(), isSimpleBD12Move(), isSimpleMove(), llvm::HexagonMCInstrInfo::isSolo(), llvm::HexagonMCInstrInfo::isSoloAX(), llvm::HexagonMCInstrInfo::isVector(), lowerRISCVVMachineInstrToMCInst(), llvm::ARMBaseInstrInfo::PredicateInstruction(), llvm::HexagonMCInstrInfo::prefersSlot3(), llvm::CSKYInstPrinter::printOperand(), producesDoubleWidthResult(), retainsPreviousHalfElement(), and vectorPseudoHasAllNBitUsers().