|
LLVM 24.0.0git
|
#include "Target/Hexagon/HexagonInstrInfo.h"
Definition at line 41 of file HexagonInstrInfo.h.
|
explicit |
Definition at line 121 of file HexagonInstrInfo.cpp.
| bool HexagonInstrInfo::addLatencyToSchedule | ( | const MachineInstr & | MI1, |
| const MachineInstr & | MI2 ) const |
Definition at line 3444 of file HexagonInstrInfo.cpp.
References isHVXVec(), and isVecUsableNextPacket().
|
inline |
Definition at line 754 of file TargetInstrInfo.h.
|
override |
Analyze the branching code at the end of MBB, returning true if it cannot be understood (e.g.
This function can analyze one/two way branching only and should (mostly) be called by target independent side.
it's a switch dispatch or isn't implemented for a target). Upon success, this returns false and returns with the following information in various cases:
Note that removeBranch and insertBranch must be implemented to support cases where this method returns success.
If AllowModify is true, then this routine is allowed to modify the basic block (e.g. delete instructions after the unconditional branch).
First entry is always the opcode of the branching instruction, except when the Cond vector is supposed to be empty, e.g., when analyzeBranch fails, a BB with only unconditional jump. Subsequent entries depend upon the opcode, e.g. Jump_c p will have Cond[0] = Jump_c Cond[1] = p HW-loop ENDLOOP: Cond[0] = ENDLOOP Cond[1] = MBB New value jump: Cond[0] = Hexagon::CMPEQri_f_Jumpnv_t_V4 – specific opcode Cond[1] = R Cond[2] = Imm
Definition at line 440 of file HexagonInstrInfo.cpp.
References Cond, llvm::MachineOperand::CreateImm(), llvm::dbgs(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineOperand::getMBB(), llvm::MachineInstr::getNumExplicitOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), I, isEndLoopN(), llvm::MachineOperand::isMBB(), isNewValueJump(), LLVM_DEBUG, MBB, PredOpcodeHasJMP_c(), llvm::printMBBReference(), and TBB.
Referenced by insertBranch().
|
override |
For a comparison instruction, return the source registers in SrcReg and SrcReg2 if having two register operands, and the value it compares against in CmpValue.
For a comparison instruction, return the source registers in SrcReg and SrcReg2 if having two register operands, and the value it compares against in CmpValue.
Return true if the comparison instruction can be analyzed.
Definition at line 2007 of file HexagonInstrInfo.cpp.
References llvm::MachineOperand::isImm(), MI, and Opc.
|
override |
Analyze loop L, which must be a single-basic-block loop, and if the conditions can be understood enough produce a PipelinerLoopInfo object.
Definition at line 815 of file HexagonInstrInfo.cpp.
References llvm::MachineBasicBlock::end(), findLoopInstr(), llvm::MachineBasicBlock::getFirstTerminator(), I, and isEndLoopN().
| bool HexagonInstrInfo::areMemAccessesDependent | ( | AAResults * | AA, |
| const MachineInstr * | MIa, | ||
| const MachineInstr * | MIb ) const |
Return true if the memory accesses of MIa and MIb may depend on each other.
This returns true if the two MIs could be memory dependent.
Uses AA, if not null, for accesses that are not trivially disjoint.
Definition at line 2186 of file HexagonInstrInfo.cpp.
References areMemAccessesTriviallyDisjoint(), assert(), llvm::MachineMemOperand::getAAInfo(), llvm::MachineMemOperand::getOffset(), llvm::MachineMemOperand::getSize(), getValue(), llvm::LocationSize::getValue(), llvm::MachineMemOperand::getValue(), llvm::MachineInstr::hasOneMemOperand(), llvm::LocationSize::hasValue(), isUnsafeMemoryObject(), llvm::MachineInstr::mayStore(), llvm::MachineInstr::memoperands_begin(), and llvm::AliasResult::NoAlias.
|
override |
Definition at line 2113 of file HexagonInstrInfo.cpp.
References getBaseAndOffsetPosition(), llvm::MachineOperand::getImm(), getMemAccessSize(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::getSubReg(), llvm::MachineInstr::hasOrderedMemoryRef(), llvm::MachineInstr::hasUnmodeledSideEffects(), llvm::MachineOperand::isImm(), isMemOp(), isPostIncrement(), and llvm::MachineInstr::mayLoad().
Referenced by areMemAccessesDependent().
| bool HexagonInstrInfo::canExecuteInBundle | ( | const MachineInstr & | First, |
| const MachineInstr & | Second ) const |
Can these instructions execute at the same time in a bundle.
Definition at line 3465 of file HexagonInstrInfo.cpp.
References DisableNVSchedule, llvm::First, llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isReg(), mayBeNewStore(), and llvm::MachineInstr::mayStore().
Referenced by llvm::HexagonSubtarget::adjustSchedDependency().
|
inline |
Definition at line 570 of file HexagonInstrInfo.h.
References changeAddrMode_abs_io(), and MI.
| short HexagonInstrInfo::changeAddrMode_abs_io | ( | short | Opc | ) | const |
Definition at line 5369 of file HexagonInstrInfo.cpp.
References Opc.
Referenced by changeAddrMode_abs_io().
|
inline |
Definition at line 573 of file HexagonInstrInfo.h.
References changeAddrMode_io_abs(), and MI.
| short HexagonInstrInfo::changeAddrMode_io_abs | ( | short | Opc | ) | const |
Definition at line 5373 of file HexagonInstrInfo.cpp.
References Opc.
Referenced by changeAddrMode_io_abs().
| short HexagonInstrInfo::changeAddrMode_io_pi | ( | short | Opc | ) | const |
Definition at line 5377 of file HexagonInstrInfo.cpp.
References Opc.
|
inline |
Definition at line 576 of file HexagonInstrInfo.h.
References changeAddrMode_io_rr(), and MI.
| short HexagonInstrInfo::changeAddrMode_io_rr | ( | short | Opc | ) | const |
Definition at line 5381 of file HexagonInstrInfo.cpp.
References Opc.
Referenced by changeAddrMode_io_rr().
| short HexagonInstrInfo::changeAddrMode_pi_io | ( | short | Opc | ) | const |
Definition at line 5385 of file HexagonInstrInfo.cpp.
References Opc.
|
inline |
Definition at line 579 of file HexagonInstrInfo.h.
References changeAddrMode_rr_io(), and MI.
| short HexagonInstrInfo::changeAddrMode_rr_io | ( | short | Opc | ) | const |
Definition at line 5389 of file HexagonInstrInfo.cpp.
References Opc.
Referenced by changeAddrMode_rr_io().
|
inline |
Definition at line 582 of file HexagonInstrInfo.h.
References changeAddrMode_rr_ur(), and MI.
| short HexagonInstrInfo::changeAddrMode_rr_ur | ( | short | Opc | ) | const |
Definition at line 5393 of file HexagonInstrInfo.cpp.
References Opc.
Referenced by changeAddrMode_rr_ur().
|
inline |
Definition at line 585 of file HexagonInstrInfo.h.
References changeAddrMode_ur_rr(), and MI.
| short HexagonInstrInfo::changeAddrMode_ur_rr | ( | short | Opc | ) | const |
Definition at line 5397 of file HexagonInstrInfo.cpp.
References Opc.
Referenced by changeAddrMode_ur_rr().
| void HexagonInstrInfo::changeDuplexOpcode | ( | MachineBasicBlock::instr_iterator | MII, |
| bool | ToBigInstrs ) const |
Definition at line 4830 of file HexagonInstrInfo.cpp.
References llvm::get(), getDuplexCandidateGroup(), and getDuplexOpcode().
Referenced by translateInstrsForDup(), and translateInstrsForDup().
|
override |
If the specified instruction defines any predicate or condition code register(s) used for predication, returns true as well as the definition predicate(s) by reference.
Definition at line 1843 of file HexagonInstrInfo.cpp.
References MI.
|
override |
Emit instructions to copy a pair of physical registers.
This function should support copies within any legal register class as well as any cross-class copies created during instruction selection.
The source and destination registers may overlap, which may require a careful implementation when multiple copy instructions are required for large registers. See for example the ARM target.
Definition at line 866 of file HexagonInstrInfo.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), contains(), llvm::LivePhysRegs::contains(), llvm::dbgs(), DL, llvm::get(), llvm::getKillRegState(), getLiveInRegsAt(), llvm::getUndefRegState(), I, llvm_unreachable, MBB, llvm::printMBBReference(), and llvm::printReg().
Referenced by expandPostRAPseudo().
|
override |
Allocate and return a hazard recognizer to use for this target when scheduling the machine instructions after register allocation.
Definition at line 1996 of file HexagonInstrInfo.cpp.
References llvm::TargetInstrInfo::CreateTargetPostRAHazardRecognizer(), II, and UseDFAHazardRec.
|
override |
Create machine specific model for scheduling.
Definition at line 2103 of file HexagonInstrInfo.cpp.
References llvm::TargetSubtargetInfo::getInstrItineraryData(), and II.
| Register HexagonInstrInfo::createVR | ( | MachineFunction * | MF, |
| MVT | VT ) const |
HexagonInstrInfo specifics.
Definition at line 2308 of file HexagonInstrInfo.cpp.
References llvm::MachineFunction::getRegInfo(), llvm_unreachable, and MRI.
|
override |
Decompose the machine operand's target flags into two values - the direct target flag value and any of bit flags that are applied.
Definition at line 2274 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::MO_Bitmasks.
| bool HexagonInstrInfo::doesNotReturn | ( | const MachineInstr & | CallMI | ) | const |
Definition at line 3490 of file HexagonInstrInfo.cpp.
References llvm::MachineInstr::getOpcode(), and Opc.
Referenced by isSchedulingBoundary().
|
override |
This function is called for all pseudo instructions that remain after register allocation.
expandPostRAPseudo - This function is called for all pseudo instructions that remain after register allocation.
Many pseudo instructions are created to help register allocation. This is the place to convert them into real instructions. The target can edit MI in place, or it can insert new instructions and erase MI. The function should return true if anything was changed.
Definition at line 1118 of file HexagonInstrInfo.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMemOperand(), llvm::MachineInstrBuilder::addReg(), llvm::MachineInstrBuilder::addUse(), llvm::all_of(), assert(), llvm::LivePhysRegs::available(), llvm::BuildMI(), llvm::cast(), llvm::MachineInstrBuilder::cloneMemRefs(), copyPhysReg(), llvm::MachineFunction::createExternalSymbolName(), DL, llvm::dyn_cast(), llvm::get(), llvm::HexagonRegisterInfo::getFrameRegister(), llvm::MachineOperand::getImm(), llvm::GlobalVariable::getInitializer(), llvm::getKillRegState(), getLiveInRegsAt(), getLiveOutRegsAt(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineOperand::getReg(), llvm::SrcOp::getReg(), llvm::MachineFunction::getRegInfo(), llvm::getRegState(), llvm::MachineOperand::getSubReg(), llvm::MachineFunction::getTarget(), llvm::getUndefRegState(), llvm::Implicit, llvm::ImplicitDefine, isConstant(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isUndef(), llvm::Kill, mayAlias(), MBB, MBBI, MI, llvm::MachineMemOperand::MOLoad, llvm::MachineMemOperand::MOVolatile, MRI, llvm::NoFlags, llvm::Offset, Opc, T, and llvm::Undef.
| MachineBasicBlock::instr_iterator HexagonInstrInfo::expandVGatherPseudo | ( | MachineInstr & | MI | ) | const |
Definition at line 1638 of file HexagonInstrInfo.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), DL, llvm::First, llvm::get(), MBB, MI, and Opc.
| MachineInstr * HexagonInstrInfo::findLoopInstr | ( | MachineBasicBlock * | BB, |
| unsigned | EndLoopOp, | ||
| MachineBasicBlock * | TargetBB, | ||
| SmallPtrSet< MachineBasicBlock *, 8 > & | Visited ) const |
Find the hardware loop instruction used to set-up the specified loop.
On Hexagon, we have two instructions used to set-up the hardware loop (LOOP0, LOOP1) with corresponding endloop (ENDLOOP0, ENDLOOP1) instructions to indicate the end of a loop.
Definition at line 199 of file HexagonInstrInfo.cpp.
References findLoopInstr(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), Opc, PB(), llvm::MachineBasicBlock::predecessors(), and llvm::reverse().
Referenced by analyzeLoopForPipelining(), findLoopInstr(), and insertBranch().
| void HexagonInstrInfo::genAllInsnTimingClasses | ( | MachineFunction & | MF | ) | const |
Definition at line 5054 of file HexagonInstrInfo.cpp.
References A(), B(), llvm::MachineFunction::begin(), llvm::BuildMI(), llvm::dbgs(), DL, llvm::MachineInstr::eraseFromParent(), llvm::get(), llvm::MachineInstr::getDesc(), getName(), llvm::MachineInstr::getOpcode(), llvm::MCInstrDesc::getSchedClass(), I, and LLVM_DEBUG.
| unsigned HexagonInstrInfo::getAddrMode | ( | const MachineInstr & | MI | ) | const |
Definition at line 3664 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::AddrModeMask, llvm::HexagonII::AddrModePos, F, and MI.
Referenced by getBankAddr(), getBaseAndOffset(), getNonExtOpcode(), hasNonExtEquivalent(), isAbsoluteSet(), isBaseImmOffset(), and isPostIncrement().
| MachineOperand * HexagonInstrInfo::getBaseAndOffset | ( | const MachineInstr & | MI, |
| int64_t & | Offset, | ||
| LocationSize & | AccessSize ) const |
Definition at line 3674 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::BaseImmOffset, llvm::HexagonII::BaseLongOffset, getAddrMode(), getBaseAndOffsetPosition(), getMemAccessSize(), llvm::MachineOperand::getSubReg(), isMemOp(), isPostIncrement(), MI, llvm::Offset, and llvm::LocationSize::precise().
Referenced by getMemOperandsWithOffsetWidth().
|
override |
For instructions with a base and offset, return the position of the base register and offset operands.
Return the position of the base and offset operands for this instruction.
Definition at line 3706 of file HexagonInstrInfo.cpp.
References isAddrModeWithOffset(), isMemOp(), isPostIncrement(), isPredicated(), and MI.
Referenced by areMemAccessesTriviallyDisjoint(), getBaseAndOffset(), getIncrementValue(), and isPostIncWithImmOffset().
| SmallVector< MachineInstr *, 2 > HexagonInstrInfo::getBranchingInstrs | ( | MachineBasicBlock & | MBB | ) | const |
Definition at line 3743 of file HexagonInstrInfo.cpp.
References I, MBB, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
| bool HexagonInstrInfo::getBundleNoShuf | ( | const MachineInstr & | MIB | ) | const |
Definition at line 5109 of file HexagonInstrInfo.cpp.
References assert(), llvm::MachineOperand::getImm(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::isBundle(), and llvm::MachineOperand::isImm().
| unsigned HexagonInstrInfo::getCExtOpNum | ( | const MachineInstr & | MI | ) | const |
Definition at line 3801 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::ExtendableOpMask, llvm::HexagonII::ExtendableOpPos, F, and MI.
Referenced by immediateExtend(), and isConstExtended().
| HexagonII::CompoundGroup HexagonInstrInfo::getCompoundCandidateGroup | ( | const MachineInstr & | MI | ) | const |
Definition at line 3808 of file HexagonInstrInfo.cpp.
References contains(), llvm::HexagonII::HCG_A, llvm::HexagonII::HCG_B, llvm::HexagonII::HCG_C, llvm::HexagonII::HCG_None, isIntRegForSubInst(), llvm::isUInt(), and MI.
Referenced by getCompoundOpcode().
| unsigned HexagonInstrInfo::getCompoundOpcode | ( | const MachineInstr & | GA, |
| const MachineInstr & | GB ) const |
Definition at line 3896 of file HexagonInstrInfo.cpp.
References assert(), getCompoundCandidateGroup(), llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::HexagonII::HCG_A, llvm::HexagonII::HCG_B, llvm::MachineOperand::isImm(), llvm::isUInt(), and llvm::MachineInstr::readsRegister().
| int HexagonInstrInfo::getCondOpcode | ( | int | Opc, |
| bool | sense ) const |
Definition at line 3980 of file HexagonInstrInfo.cpp.
References llvm_unreachable, and Opc.
Referenced by PredicateInstruction().
| int HexagonInstrInfo::getDotCurOp | ( | const MachineInstr & | MI | ) | const |
Definition at line 3992 of file HexagonInstrInfo.cpp.
References llvm_unreachable, and MI.
| int HexagonInstrInfo::getDotNewOp | ( | const MachineInstr & | MI | ) | const |
Definition at line 4113 of file HexagonInstrInfo.cpp.
References MI, and llvm::report_fatal_error().
| int HexagonInstrInfo::getDotNewPredJumpOp | ( | const MachineInstr & | MI, |
| const MachineBranchProbabilityInfo * | MBPI ) const |
Definition at line 4154 of file HexagonInstrInfo.cpp.
References assert(), B(), llvm::MachineBranchProbabilityInfo::getEdgeProbability(), llvm::MachineOperand::getMBB(), I, llvm::MachineOperand::isMBB(), llvm_unreachable, and MI.
Referenced by getDotNewPredOp().
| int HexagonInstrInfo::getDotNewPredOp | ( | const MachineInstr & | MI, |
| const MachineBranchProbabilityInfo * | MBPI ) const |
Definition at line 4240 of file HexagonInstrInfo.cpp.
References getDotNewPredJumpOp(), and MI.
| int HexagonInstrInfo::getDotOldOp | ( | const MachineInstr & | MI | ) | const |
Definition at line 4255 of file HexagonInstrInfo.cpp.
References assert(), isNewValueStore(), isPredicated(), isPredicatedNew(), and MI.
| HexagonII::SubInstructionGroup HexagonInstrInfo::getDuplexCandidateGroup | ( | const MachineInstr & | MI | ) | const |
Definition at line 4306 of file HexagonInstrInfo.cpp.
References contains(), llvm::HexagonRegisterInfo::getStackRegister(), llvm::HexagonII::HSIG_A, llvm::HexagonII::HSIG_L1, llvm::HexagonII::HSIG_L2, llvm::HexagonII::HSIG_None, llvm::HexagonII::HSIG_S1, llvm::HexagonII::HSIG_S2, isDblRegForSubInst(), llvm::isInt(), isIntRegForSubInst(), llvm::isShiftedInt(), llvm::isShiftedUInt(), llvm::isUInt(), and MI.
Referenced by changeDuplexOpcode(), and isDuplexPair().
| int HexagonInstrInfo::getDuplexOpcode | ( | const MachineInstr & | MI, |
| bool | ForBigCore = true ) const |
Definition at line 3923 of file HexagonInstrInfo.cpp.
References MI.
Referenced by changeDuplexOpcode().
|
override |
If the instruction is an increment of a constant value, return the amount.
Definition at line 2251 of file HexagonInstrInfo.cpp.
References getBaseAndOffsetPosition(), isPostIncrement(), and MI.
|
override |
Measure the specified inline asm to determine an approximation of its length.
Comments (which run till the next SeparatorString or newline) do not count as an instruction. Any other non-whitespace text is considered an instruction, with multiple instructions separated by SeparatorString or newlines. Variable-length instructions are not handled here; this function may be overloaded in the target code to do that. Hexagon counts the number of ##'s and adjust for that many constant exenders.
Definition at line 1968 of file HexagonInstrInfo.cpp.
References llvm::StringRef::count(), llvm::StringRef::data(), llvm::MCAsmInfo::getCommentString(), llvm::MCAsmInfo::getMaxInstLength(), llvm::MCAsmInfo::getSeparatorString(), llvm::isSpace(), llvm::Length, and llvm::StringRef::size().
Referenced by getSize().
|
inlineoverride |
Definition at line 56 of file HexagonInstrInfo.h.
References C().
|
override |
Compute the instruction latency of a given instruction.
If the instruction has higher cost when predicated, it's returned via PredCost.
Definition at line 2097 of file HexagonInstrInfo.cpp.
References getInstrTimingClassLatency(), and MI.
Referenced by getInstrTimingClassLatency().
| unsigned HexagonInstrInfo::getInstrTimingClassLatency | ( | const InstrItineraryData * | ItinData, |
| const MachineInstr & | MI ) const |
Definition at line 4686 of file HexagonInstrInfo.cpp.
References getInstrLatency(), llvm::InstrItineraryData::getStageLatency(), and MI.
Referenced by getInstrLatency().
Definition at line 4759 of file HexagonInstrInfo.cpp.
References isPredicatedTrue(), llvm_unreachable, and Opc.
Referenced by getInvertedPredSense(), invertAndChangeJumpTarget(), reverseBranchCondition(), and reversePredSense().
| bool HexagonInstrInfo::getInvertedPredSense | ( | SmallVectorImpl< MachineOperand > & | Cond | ) | const |
Definition at line 4750 of file HexagonInstrInfo.cpp.
References Cond, llvm::getImm(), getInvertedPredicatedOpcode(), and Opc.
| int HexagonInstrInfo::getMaxValue | ( | const MachineInstr & | MI | ) | const |
Definition at line 4770 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::ExtentBitsMask, llvm::HexagonII::ExtentBitsPos, llvm::HexagonII::ExtentSignedMask, llvm::HexagonII::ExtentSignedPos, F, isSigned(), and MI.
Referenced by isConstExtended().
| unsigned HexagonInstrInfo::getMemAccessSize | ( | const MachineInstr & | MI | ) | const |
Definition at line 4867 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::DoubleWordAccess, F, llvm::HexagonII::HLXVectorAccess, llvm::HexagonII::HVXVectorAccess, llvm_unreachable, MI, and llvm::Size.
Referenced by areMemAccessesTriviallyDisjoint(), getBankAddr(), and getBaseAndOffset().
|
override |
Get the base register and byte offset of a load/store instr.
Definition at line 3453 of file HexagonInstrInfo.cpp.
References getBaseAndOffset(), llvm::MachineOperand::isReg(), llvm::Offset, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
| int HexagonInstrInfo::getMinValue | ( | const MachineInstr & | MI | ) | const |
Definition at line 4892 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::ExtentBitsMask, llvm::HexagonII::ExtentBitsPos, llvm::HexagonII::ExtentSignedMask, llvm::HexagonII::ExtentSignedPos, F, isSigned(), and MI.
Referenced by isConstExtended().
| int HexagonInstrInfo::getNonDotCurOp | ( | const MachineInstr & | MI | ) | const |
Definition at line 4012 of file HexagonInstrInfo.cpp.
References llvm_unreachable, and MI.
| short HexagonInstrInfo::getNonExtOpcode | ( | const MachineInstr & | MI | ) | const |
Definition at line 4906 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::Absolute, llvm::HexagonII::BaseImmOffset, llvm::HexagonII::BaseLongOffset, getAddrMode(), and MI.
|
override |
Definition at line 5401 of file HexagonInstrInfo.cpp.
References llvm::MCInstBuilder::addImm(), and llvm::MCInstBuilder::addInst().
|
override |
getOperandLatency - Compute and return the use operand latency of a given pair of def and use.
In most cases, the static scheduling itinerary was enough to determine the operand latency. But it may not be possible for instructions with variable number of defs / uses.
This is a raw interface to the itinerary that may be directly overridden by a target. Use computeOperandLatency to get the best estimate of latency.
Definition at line 4706 of file HexagonInstrInfo.cpp.
References DefMI, llvm::TargetInstrInfo::getOperandLatency(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isImplicit(), llvm::Register::isPhysical(), llvm::MachineOperand::isReg(), llvm::Latency, and UseMI.
| bool HexagonInstrInfo::getPredReg | ( | ArrayRef< MachineOperand > | Cond, |
| Register & | PredReg, | ||
| unsigned & | PredRegPos, | ||
| RegState & | PredRegFlags ) const |
Definition at line 4930 of file HexagonInstrInfo.cpp.
References assert(), Cond, llvm::dbgs(), llvm::getImm(), llvm::Implicit, isNewValueJump(), isUndef(), LLVM_DEBUG, and llvm::Undef.
Referenced by PredicateInstruction().
| short HexagonInstrInfo::getRegForm | ( | const MachineInstr & | MI | ) | const |
Definition at line 4951 of file HexagonInstrInfo.cpp.
References MI.
|
inline |
Definition at line 54 of file HexagonInstrInfo.h.
Referenced by cannotCoexistAsymm(), and llvm::HexagonDAGToDAGISel::runOnMachineFunction().
|
override |
Return an array that contains the bitmask target flag values and their names.
MIR Serialization is able to serialize only the target flags that are defined by this method.
Definition at line 2299 of file HexagonInstrInfo.cpp.
References llvm::ArrayRef().
|
override |
Return an array that contains the direct target flag values and their names.
MIR Serialization is able to serialize only the target flags that are defined by this method.
Definition at line 2280 of file HexagonInstrInfo.cpp.
References llvm::ArrayRef().
| unsigned HexagonInstrInfo::getSize | ( | const MachineInstr & | MI | ) | const |
Definition at line 4959 of file HexagonInstrInfo.cpp.
References assert(), BranchRelaxAsmLarge, getInlineAsmLength(), llvm::TargetMachine::getMCAsmInfo(), llvm::MachineFunction::getTarget(), HEXAGON_INSTR_SIZE, isConstExtended(), isExtended(), isReg(), MBB, MI, and llvm::Size.
| uint64_t HexagonInstrInfo::getType | ( | const MachineInstr & | MI | ) | const |
Definition at line 4993 of file HexagonInstrInfo.cpp.
References F, MI, llvm::HexagonII::TypeMask, and llvm::HexagonII::TypePos.
Referenced by cannotCoexistAsymm(), isCompoundBranchInstr(), isHVXVec(), and isLateSourceInstr().
| InstrStage::FuncUnits HexagonInstrInfo::getUnits | ( | const MachineInstr & | MI | ) | const |
Definition at line 4998 of file HexagonInstrInfo.cpp.
Referenced by isPureSlot0().
| bool HexagonInstrInfo::hasEHLabel | ( | const MachineBasicBlock * | B | ) | const |
Definition at line 3495 of file HexagonInstrInfo.cpp.
|
override |
Check if the instruction or the bundle of instructions has load from stack slots.
This function checks if the instruction or bundle of instructions has load from stack slot and returns frameindex and machine memory operand of that instruction if true.
Return the frameindex and machine memory operand if true.
Definition at line 392 of file HexagonInstrInfo.cpp.
References Accesses, llvm::TargetInstrInfo::hasLoadFromStackSlot(), MBB, and MI.
| bool HexagonInstrInfo::hasNonExtEquivalent | ( | const MachineInstr & | MI | ) | const |
Definition at line 3504 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::Absolute, llvm::HexagonII::BaseImmOffset, llvm::HexagonII::BaseLongOffset, getAddrMode(), and MI.
| bool HexagonInstrInfo::hasQFPInstrs | ( | const MachineFunction & | MF | ) | const |
Definition at line 5296 of file HexagonInstrInfo.cpp.
References isQFPInstr(), MBB, and MI.
|
override |
Check if the instruction or the bundle of instructions has store to stack slots.
This function checks if the instruction or bundle of instructions has store to stack slot and returns frameindex and machine memory operand of that instruction if true.
Return the frameindex and machine memory operand if true.
Definition at line 410 of file HexagonInstrInfo.cpp.
References Accesses, llvm::TargetInstrInfo::hasStoreToStackSlot(), MBB, and MI.
| bool HexagonInstrInfo::hasUncondBranch | ( | const MachineBasicBlock * | B | ) | const |
Definition at line 3539 of file HexagonInstrInfo.cpp.
| void HexagonInstrInfo::immediateExtend | ( | MachineInstr & | MI | ) | const |
immediateExtend - Changes the instruction in place to one using an immediate extender.
Definition at line 5020 of file HexagonInstrInfo.cpp.
References llvm::MachineOperand::addTargetFlag(), assert(), getCExtOpNum(), llvm::HexagonII::HMOTF_ConstExtended, isConstExtended(), isExtendable(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isMBB(), and MI.
|
override |
Insert branch code into the end of the specified MachineBasicBlock.
The operands to this method are the same as those returned by analyzeBranch. This is only invoked in cases where analyzeBranch returns success. It returns the number of instructions inserted.
It is also invoked by tail merging to add unconditional branches in cases where analyzeBranch doesn't apply because there was no original branch to analyze. At least this much must be implemented, else tail merging needs to be disabled.
Definition at line 633 of file HexagonInstrInfo.cpp.
References llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), analyzeBranch(), assert(), llvm::BuildMI(), Cond, llvm::dbgs(), DL, findLoopInstr(), llvm::get(), llvm::getImm(), getReg(), llvm::MachineOperand::getReg(), llvm::getUndefRegState(), insertBranch(), isEndLoopN(), isNewValueJump(), isPredicated(), isReg(), isUndef(), llvm::MachineOperand::isUndef(), LLVM_DEBUG, llvm_unreachable, MBB, llvm::printMBBReference(), removeBranch(), reverseBranchCondition(), TBB, and validateBranchCond().
Referenced by insertBranch().
|
override |
Insert a noop into the instruction stream at the specified point.
Definition at line 1754 of file HexagonInstrInfo.cpp.
References llvm::BuildMI(), DL, llvm::get(), MBB, and MI.
| bool HexagonInstrInfo::invertAndChangeJumpTarget | ( | MachineInstr & | MI, |
| MachineBasicBlock * | NewTarget ) const |
Definition at line 5033 of file HexagonInstrInfo.cpp.
References assert(), llvm::dbgs(), EnableBranchPrediction, llvm::get(), getInvertedPredicatedOpcode(), isPredicatedNew(), LLVM_DEBUG, MI, llvm::printMBBReference(), and reversePrediction().
| bool HexagonInstrInfo::isAbsoluteSet | ( | const MachineInstr & | MI | ) | const |
Definition at line 2325 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::AbsoluteSet, getAddrMode(), and MI.
| bool HexagonInstrInfo::isAccumulator | ( | const MachineInstr & | MI | ) | const |
Definition at line 2329 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::AccumulatorMask, llvm::HexagonII::AccumulatorPos, F, and MI.
Referenced by isVecAcc().
| bool HexagonInstrInfo::isActivateWeightPair | ( | const MachineInstr & | MIa, |
| const MachineInstr & | MIb ) const |
Definition at line 2633 of file HexagonInstrInfo.cpp.
References isHMXActivateInstr(), and isHMXWeightInstr().
| bool HexagonInstrInfo::isAddrModeWithOffset | ( | const MachineInstr & | MI | ) | const |
Definition at line 4784 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::AddrModeMask, llvm::HexagonII::AddrModePos, llvm::HexagonII::BaseImmOffset, llvm::HexagonII::BaseLongOffset, llvm::HexagonII::BaseRegOffset, F, and MI.
Referenced by getBaseAndOffsetPosition().
|
override |
Definition at line 156 of file HexagonInstrInfo.cpp.
References Imm, llvm::isInt(), and MI.
|
override |
Definition at line 1906 of file HexagonInstrInfo.cpp.
References llvm::MachineInstr::FmReassoc, llvm::MachineInstr::getFlag(), and llvm::MachineInstr::getOpcode().
| bool HexagonInstrInfo::isBaseImmOffset | ( | const MachineInstr & | MI | ) | const |
Definition at line 2334 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::BaseImmOffset, getAddrMode(), and MI.
| bool HexagonInstrInfo::isComplex | ( | const MachineInstr & | MI | ) | const |
Definition at line 2338 of file HexagonInstrInfo.cpp.
References isMemOp(), isTC1(), isTC2Early(), and MI.
Referenced by cannotCoexistAsymm().
| bool HexagonInstrInfo::isCompoundBranchInstr | ( | const MachineInstr & | MI | ) | const |
Definition at line 2347 of file HexagonInstrInfo.cpp.
References getType(), MI, and llvm::HexagonII::TypeCJ.
| bool HexagonInstrInfo::isConstExtended | ( | const MachineInstr & | MI | ) | const |
Definition at line 2353 of file HexagonInstrInfo.cpp.
References assert(), llvm::HexagonII::ExtendableMask, llvm::HexagonII::ExtendablePos, llvm::HexagonII::ExtendedMask, llvm::HexagonII::ExtendedPos, llvm::HexagonII::ExtentSignedMask, llvm::HexagonII::ExtentSignedPos, F, getCExtOpNum(), llvm::MachineOperand::getImm(), getMaxValue(), getMinValue(), llvm::MachineOperand::getTargetFlags(), llvm::HexagonII::HMOTF_ConstExtended, llvm::MachineOperand::isBlockAddress(), llvm::MachineOperand::isCPI(), isExtendable(), isExtended(), llvm::MachineOperand::isFPImm(), llvm::MachineOperand::isGlobal(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isJTI(), llvm::MachineOperand::isMBB(), llvm::MachineOperand::isSymbol(), and MI.
Referenced by getSize(), and immediateExtend().
| bool HexagonInstrInfo::isDeallocRet | ( | const MachineInstr & | MI | ) | const |
Definition at line 2402 of file HexagonInstrInfo.cpp.
References MI.
| bool HexagonInstrInfo::isDependent | ( | const MachineInstr & | ProdMI, |
| const MachineInstr & | ConsMI ) const |
Definition at line 2417 of file HexagonInstrInfo.cpp.
References llvm::MachineInstr::getDesc(), llvm::MCInstrDesc::getNumDefs(), llvm::is_contained(), and parseOperands().
Referenced by producesStall().
| bool HexagonInstrInfo::isDotCurInst | ( | const MachineInstr & | MI | ) | const |
Definition at line 2448 of file HexagonInstrInfo.cpp.
References MI.
Referenced by isDotCurOperand().
| bool HexagonInstrInfo::isDotCurOperand | ( | const MachineInstr & | MI, |
| unsigned | OpIndex ) const |
Returns true if the specified operand is a .cur (current) operand.
.cur operands can be used immediately in the same packet. This function checks:
Definition at line 2566 of file HexagonInstrInfo.cpp.
References llvm::MachineOperand::isDef(), isDotCurInst(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isTied(), and MI.
Referenced by isSafeInBundleWAR().
| bool HexagonInstrInfo::isDotNewInst | ( | const MachineInstr & | MI | ) | const |
Definition at line 2610 of file HexagonInstrInfo.cpp.
References isNewValueInst(), isPredicated(), isPredicatedNew(), and MI.
Referenced by isDotNewOperand().
| bool HexagonInstrInfo::isDotNewOperand | ( | const MachineInstr & | MI, |
| unsigned | OpIndex ) const |
Should be able to tell if the operand in question is .new.
Instead of exhaustive case statement (which would be prohibitively large) we use a set of rules.
Definition at line 2485 of file HexagonInstrInfo.cpp.
References llvm::MachineOperand::getReg(), llvm::MachineOperand::isDef(), isDotNewInst(), llvm::HexagonRegisterInfo::isFakeReg(), llvm::MachineOperand::isInternalRead(), isNewValueJump(), isNewValueStore(), isPredicated(), llvm::MachineOperand::isReg(), llvm_unreachable, and MI.
Referenced by isSafeInBundleWAR().
| bool HexagonInstrInfo::isDotTmpInst | ( | const MachineInstr & | MI | ) | const |
Definition at line 2535 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::getTSFlag(), llvm::HexagonII::isTmpWritePos, and MI.
Referenced by isDotTmpOperand().
| bool HexagonInstrInfo::isDotTmpOperand | ( | const MachineInstr & | MI, |
| unsigned | OpIndex ) const |
Returns true if the specified operand is a .tmp (temporary) operand.
.tmp operands represent temporary values that are used in the same packet. This function checks:
Definition at line 2545 of file HexagonInstrInfo.cpp.
References llvm::MachineOperand::isDef(), isDotTmpInst(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isTied(), and MI.
Referenced by isSafeInBundleWAR().
| bool HexagonInstrInfo::isDuplexPair | ( | const MachineInstr & | MIa, |
| const MachineInstr & | MIb ) const |
Symmetrical. See if these two instructions are fit for duplex pair.
Definition at line 2618 of file HexagonInstrInfo.cpp.
References getDuplexCandidateGroup(), and isDuplexPairMatch().
Definition at line 2639 of file HexagonInstrInfo.cpp.
Referenced by analyzeBranch(), analyzeLoopForPipelining(), insertBranch(), PredicateInstruction(), and reverseBranchCondition().
Definition at line 2644 of file HexagonInstrInfo.cpp.
References llvm::MachineOperand::MO_BlockAddress, llvm::MachineOperand::MO_ConstantPoolIndex, llvm::MachineOperand::MO_ExternalSymbol, llvm::MachineOperand::MO_GlobalAddress, llvm::MachineOperand::MO_JumpTableIndex, and llvm::MachineOperand::MO_MachineBasicBlock.
| bool HexagonInstrInfo::isExtendable | ( | const MachineInstr & | MI | ) | const |
Definition at line 2658 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::ExtendableMask, llvm::HexagonII::ExtendablePos, F, MI, and llvm::MCInstrDesc::TSFlags.
Referenced by immediateExtend(), and isConstExtended().
| bool HexagonInstrInfo::isExtended | ( | const MachineInstr & | MI | ) | const |
Definition at line 2680 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::ExtendedMask, llvm::HexagonII::ExtendedPos, F, llvm::HexagonII::HMOTF_ConstExtended, and MI.
Referenced by getSize(), and isConstExtended().
| bool HexagonInstrInfo::isFloat | ( | const MachineInstr & | MI | ) | const |
Definition at line 2693 of file HexagonInstrInfo.cpp.
References F, llvm::HexagonII::FPMask, llvm::HexagonII::FPPos, llvm::get(), and MI.
Referenced by cannotCoexistAsymm(), and shouldSink().
| bool HexagonInstrInfo::isHLXVec | ( | const MachineInstr & | MI | ) | const |
Definition at line 3082 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::isHLXMask, llvm::HexagonII::isHLXPos, and MI.
Referenced by cannotCoexistAsymm(), and getBankAddr().
| bool HexagonInstrInfo::isHMXActivateInstr | ( | const MachineInstr & | MI | ) | const |
Definition at line 2625 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::getTSFlag(), llvm::HexagonII::isHMXActivatePos, and MI.
Referenced by isActivateWeightPair().
| bool HexagonInstrInfo::isHMXWeightInstr | ( | const MachineInstr & | MI | ) | const |
Definition at line 2629 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::getTSFlag(), llvm::HexagonII::isHMXWeightPos, and MI.
Referenced by isActivateWeightPair().
| bool HexagonInstrInfo::isHVXMemWithAIndirect | ( | const MachineInstr & | I, |
| const MachineInstr & | J ) const |
Definition at line 2700 of file HexagonInstrInfo.cpp.
References I, isHVXVec(), llvm::MachineInstr::isIndirectBranch(), isIndirectCall(), and isIndirectL4Return().
Referenced by cannotCoexistAsymm().
| bool HexagonInstrInfo::isHVXVec | ( | const MachineInstr & | MI | ) | const |
Definition at line 3077 of file HexagonInstrInfo.cpp.
References getType(), MI, llvm::HexagonII::TypeCVI_FIRST, and llvm::HexagonII::TypeCVI_LAST.
Referenced by addLatencyToSchedule(), isHVXMemWithAIndirect(), isVecAcc(), producesStall(), producesStall(), and llvm::HexagonSubtarget::updateLatency().
| bool HexagonInstrInfo::isIndirectCall | ( | const MachineInstr & | MI | ) | const |
Definition at line 2709 of file HexagonInstrInfo.cpp.
References MI.
Referenced by isHVXMemWithAIndirect().
| bool HexagonInstrInfo::isIndirectL4Return | ( | const MachineInstr & | MI | ) | const |
Definition at line 2720 of file HexagonInstrInfo.cpp.
References MI.
Referenced by isHVXMemWithAIndirect().
| bool HexagonInstrInfo::isJumpR | ( | const MachineInstr & | MI | ) | const |
Definition at line 2734 of file HexagonInstrInfo.cpp.
References MI.
| bool HexagonInstrInfo::isJumpWithinBranchRange | ( | const MachineInstr & | MI, |
| unsigned | offset ) const |
Definition at line 2752 of file HexagonInstrInfo.cpp.
References llvm::isInt(), isNewValueJump(), and MI.
| bool HexagonInstrInfo::isLateSourceInstr | ( | const MachineInstr & | MI | ) | const |
Definition at line 2794 of file HexagonInstrInfo.cpp.
References getType(), MI, and llvm::HexagonII::TypeCVI_VX_LATE.
Referenced by isVecUsableNextPacket().
|
override |
TargetInstrInfo overrides.
isLoadFromStackSlot - If the specified machine instruction is a direct load from a stack slot, return the virtual or physical register number of the destination along with the FrameIndex of the loaded stack slot.
If the specified machine instruction is a direct load from a stack slot, return the virtual or physical register number of the destination along with the FrameIndex of the loaded stack slot. If not, return 0. This predicate must return 0 if the instruction has any side effects other than loading from the stack slot.
If not, return 0. This predicate must return 0 if the instruction has any side effects other than loading from the stack slot.
Definition at line 290 of file HexagonInstrInfo.cpp.
References llvm::MachineOperand::getImm(), llvm::MachineOperand::getIndex(), llvm::MachineOperand::isFI(), llvm::MachineOperand::isImm(), and MI.
| bool HexagonInstrInfo::isLoopN | ( | const MachineInstr & | MI | ) | const |
Definition at line 2800 of file HexagonInstrInfo.cpp.
References MI.
| bool HexagonInstrInfo::isMemOp | ( | const MachineInstr & | MI | ) | const |
Definition at line 2812 of file HexagonInstrInfo.cpp.
References MI.
Referenced by areMemAccessesTriviallyDisjoint(), getBankAddr(), getBaseAndOffset(), getBaseAndOffsetPosition(), and isComplex().
| bool HexagonInstrInfo::isMIBefore | ( | const MachineInstr * | A, |
| const MachineInstr * | B ) const |
Definition at line 5305 of file HexagonInstrInfo.cpp.
| bool HexagonInstrInfo::isNewStorePseudo | ( | const MachineInstr & | MI | ) | const |
Definition at line 3570 of file HexagonInstrInfo.cpp.
References MI.
Referenced by llvm::HexagonSubtarget::HLXPseudoMutation::apply().
| bool HexagonInstrInfo::isNewValue | ( | const MachineInstr & | MI | ) | const |
Definition at line 2844 of file HexagonInstrInfo.cpp.
References F, MI, llvm::HexagonII::NewValueMask, and llvm::HexagonII::NewValuePos.
Referenced by isNewValueJump(), isNewValueJump(), and isPredictedTaken().
Definition at line 2849 of file HexagonInstrInfo.cpp.
References F, llvm::get(), llvm::HexagonII::NewValueMask, and llvm::HexagonII::NewValuePos.
| bool HexagonInstrInfo::isNewValueInst | ( | const MachineInstr & | MI | ) | const |
Definition at line 2854 of file HexagonInstrInfo.cpp.
References isNewValueJump(), isNewValueStore(), and MI.
Referenced by isDotNewInst().
| bool HexagonInstrInfo::isNewValueJump | ( | const MachineInstr & | MI | ) | const |
Definition at line 2858 of file HexagonInstrInfo.cpp.
References isNewValue(), and MI.
Referenced by analyzeBranch(), getPredReg(), insertBranch(), isDotNewOperand(), isJumpWithinBranchRange(), isNewValueInst(), and PredicateInstruction().
Definition at line 2862 of file HexagonInstrInfo.cpp.
References llvm::get(), isNewValue(), and isPredicated().
| bool HexagonInstrInfo::isNewValueStore | ( | const MachineInstr & | MI | ) | const |
Definition at line 2866 of file HexagonInstrInfo.cpp.
References F, MI, llvm::HexagonII::NVStoreMask, and llvm::HexagonII::NVStorePos.
Referenced by cannotCoexistAsymm(), getDotOldOp(), isDotNewOperand(), and isNewValueInst().
Definition at line 2871 of file HexagonInstrInfo.cpp.
References F, llvm::get(), llvm::HexagonII::NVStoreMask, and llvm::HexagonII::NVStorePos.
| bool HexagonInstrInfo::isOperandExtended | ( | const MachineInstr & | MI, |
| unsigned | OperandNum ) const |
Definition at line 2877 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::ExtendableOpMask, llvm::HexagonII::ExtendableOpPos, F, and MI.
|
override |
Return true for post-incremented instructions.
Definition at line 1760 of file HexagonInstrInfo.cpp.
References getAddrMode(), MI, and llvm::HexagonII::PostInc.
Referenced by areMemAccessesTriviallyDisjoint(), getBankAddr(), getBaseAndOffset(), getBaseAndOffsetPosition(), getIncrementValue(), getPostIncrementOperand(), and isPostIncWithImmOffset().
| bool HexagonInstrInfo::isPostIncWithImmOffset | ( | const MachineInstr & | MI | ) | const |
Definition at line 1764 of file HexagonInstrInfo.cpp.
References getBaseAndOffsetPosition(), isPostIncrement(), and MI.
|
override |
Return true if the specified instruction can be predicated.
By default, this returns true for every instruction with a PredicateOperand.
Definition at line 1870 of file HexagonInstrInfo.cpp.
References isTailCall(), and MI.
Referenced by PredicateInstruction().
|
override |
Returns true if the instruction is already predicated.
Definition at line 1779 of file HexagonInstrInfo.cpp.
References F, MI, llvm::HexagonII::PredicatedMask, and llvm::HexagonII::PredicatedPos.
Referenced by getBankAddr(), getBaseAndOffsetPosition(), getDotOldOp(), getPredicatedRegister(), getPredicateSense(), insertBranch(), isDotNewInst(), isDotNewOperand(), isNewValueJump(), isPredicatedDef(), isPredicatedNew(), isPredicatedNew(), and predOpcodeHasNot().
Definition at line 2910 of file HexagonInstrInfo.cpp.
References F, llvm::get(), llvm::HexagonII::PredicatedMask, and llvm::HexagonII::PredicatedPos.
| bool HexagonInstrInfo::isPredicatedNew | ( | const MachineInstr & | MI | ) | const |
Definition at line 2884 of file HexagonInstrInfo.cpp.
References assert(), F, isPredicated(), MI, llvm::HexagonII::PredicatedNewMask, and llvm::HexagonII::PredicatedNewPos.
Referenced by getDotOldOp(), invertAndChangeJumpTarget(), isDotNewInst(), and isPredictedTaken().
Definition at line 2890 of file HexagonInstrInfo.cpp.
References assert(), F, llvm::get(), isPredicated(), llvm::HexagonII::PredicatedNewMask, and llvm::HexagonII::PredicatedNewPos.
| bool HexagonInstrInfo::isPredicatedTrue | ( | const MachineInstr & | MI | ) | const |
Definition at line 2896 of file HexagonInstrInfo.cpp.
References F, MI, llvm::HexagonII::PredicatedFalseMask, and llvm::HexagonII::PredicatedFalsePos.
Referenced by getInvertedPredicatedOpcode(), getPredicateSense(), and predOpcodeHasNot().
Definition at line 2902 of file HexagonInstrInfo.cpp.
References assert(), F, llvm::get(), llvm::HexagonII::PredicatedFalseMask, llvm::HexagonII::PredicatedFalsePos, llvm::HexagonII::PredicatedMask, and llvm::HexagonII::PredicatedPos.
Definition at line 2915 of file HexagonInstrInfo.cpp.
References F, llvm::get(), llvm::HexagonII::PredicateLateMask, and llvm::HexagonII::PredicateLatePos.
Definition at line 2920 of file HexagonInstrInfo.cpp.
References assert(), F, llvm::get(), isBranch(), isNewValue(), isPredicatedNew(), llvm::HexagonII::TakenMask, and llvm::HexagonII::TakenPos.
Referenced by reversePrediction().
|
override |
Return true if it's profitable for if-converter to duplicate instructions of specified accumulated instruction latencies in the specified MBB to enable if-conversion.
The probability of the instructions being executed is given by Probability, and Confidence is a measure of our confidence that it will be properly predicted.
Definition at line 842 of file HexagonInstrInfo.cpp.
References MBB.
|
override |
Return true if it's profitable to predicate instructions with accumulated instruction latency of "NumCycles" of the specified basic block, where the probability of the instructions being executed is given by Probability, and Confidence is a measure of our confidence that it will be properly predicted.
Definition at line 829 of file HexagonInstrInfo.cpp.
References MBB, and nonDbgBBSize().
|
override |
Second variant of isProfitableToIfCvt.
This one checks for the case where two basic blocks from true and false path of a if-then-else (diamond) are predicated on mutually exclusive predicates, where the probability of the true path being taken is given by Probability, and Confidence is a measure of our confidence that it will be properly predicted.
Definition at line 835 of file HexagonInstrInfo.cpp.
References nonDbgBBSize().
| bool HexagonInstrInfo::isPureSlot0 | ( | const MachineInstr & | MI | ) | const |
Definition at line 4812 of file HexagonInstrInfo.cpp.
References getUnits(), llvm::HexagonFUnits::isSlot0Only(), and MI.
Referenced by cannotCoexistAsymm().
| bool HexagonInstrInfo::isQFP16Instr | ( | MachineInstr * | MI | ) | const |
Definition at line 5287 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::getOpRegType(), MI, and llvm::HexagonII::QF16.
Referenced by isQFPInstr().
| bool HexagonInstrInfo::isQFP32Instr | ( | MachineInstr * | MI | ) | const |
Definition at line 5283 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::getOpRegType(), MI, and llvm::HexagonII::QF32.
Referenced by isQFPInstr().
| bool HexagonInstrInfo::isQFPInstr | ( | MachineInstr * | MI | ) | const |
Definition at line 5291 of file HexagonInstrInfo.cpp.
References isQFP16Instr(), isQFP32Instr(), and MI.
Referenced by hasQFPInstrs().
| bool HexagonInstrInfo::isQFPMul | ( | const MachineInstr * | MF | ) | const |
Definition at line 5115 of file HexagonInstrInfo.cpp.
References MI.
| bool HexagonInstrInfo::isRestrictNoSlot1Store | ( | const MachineInstr & | MI | ) | const |
Definition at line 4824 of file HexagonInstrInfo.cpp.
References F, MI, llvm::HexagonII::RestrictNoSlot1StoreMask, and llvm::HexagonII::RestrictNoSlot1StorePos.
Referenced by cannotCoexistAsymm().
| bool HexagonInstrInfo::isSafeInBundleWAR | ( | const MachineInstr & | DefMI, |
| unsigned | DefOpIdx, | ||
| const MachineInstr & | UseMI, | ||
| unsigned | UseOpIdx, | ||
| bool | IsPullDown = false, | ||
| bool | DefViaRegMask = false ) const |
A use (UseMI) can share a bundle with an instruction that redefines the same register (DefMI), the use still sees the old value (WAR).
Returns true when that holds: no operand forwarding (.new/.tmp/.cur) exposes the new value. Caller ensures same-bundle intent. IsPullDown (push-down) is not yet supported and always returns false. DefViaRegMask = true when the def is a regmask clobber (no operand): such a def never forwards, so the def-side operand checks are skipped.
Definition at line 2581 of file HexagonInstrInfo.cpp.
References DefMI, isDotCurOperand(), isDotNewOperand(), isDotTmpOperand(), and UseMI.
| bool HexagonInstrInfo::isSaveCalleeSavedRegsCall | ( | const MachineInstr & | MI | ) | const |
Definition at line 2927 of file HexagonInstrInfo.cpp.
References MI.
|
override |
Test if the given instruction should be considered a scheduling boundary.
This primarily includes labels and terminators.
Definition at line 1920 of file HexagonInstrInfo.cpp.
References doesNotReturn(), I, MBB, MI, and ScheduleInlineAsm.
| bool HexagonInstrInfo::isSignExtendingLoad | ( | const MachineInstr & | MI | ) | const |
Definition at line 2934 of file HexagonInstrInfo.cpp.
References MI.
| bool HexagonInstrInfo::isSolo | ( | const MachineInstr & | MI | ) | const |
Definition at line 3012 of file HexagonInstrInfo.cpp.
References F, MI, llvm::HexagonII::SoloMask, and llvm::HexagonII::SoloPos.
| bool HexagonInstrInfo::isSpillPredRegOp | ( | const MachineInstr & | MI | ) | const |
Definition at line 3017 of file HexagonInstrInfo.cpp.
References MI.
|
override |
If the specified machine instruction is a direct store to a stack slot, return the virtual or physical register number of the source reg along with the FrameIndex of the loaded stack slot.
isStoreToStackSlot - If the specified machine instruction is a direct store to a stack slot, return the virtual or physical register number of the source reg along with the FrameIndex of the loaded stack slot.
If not, return 0. This predicate must return 0 if the instruction has any side effects other than storing to the stack slot.
Definition at line 340 of file HexagonInstrInfo.cpp.
References llvm::MachineOperand::getImm(), llvm::MachineOperand::getIndex(), llvm::MachineOperand::isFI(), llvm::MachineOperand::isImm(), and MI.
|
override |
| bool HexagonInstrInfo::isTC1 | ( | const MachineInstr & | MI | ) | const |
Definition at line 3038 of file HexagonInstrInfo.cpp.
References llvm::is_TC1(), and MI.
Referenced by isComplex().
| bool HexagonInstrInfo::isTC2 | ( | const MachineInstr & | MI | ) | const |
Definition at line 3043 of file HexagonInstrInfo.cpp.
References llvm::is_TC2(), and MI.
| bool HexagonInstrInfo::isTC2Early | ( | const MachineInstr & | MI | ) | const |
Definition at line 3048 of file HexagonInstrInfo.cpp.
References llvm::is_TC2early(), and MI.
Referenced by isComplex().
| bool HexagonInstrInfo::isTC4x | ( | const MachineInstr & | MI | ) | const |
Definition at line 3053 of file HexagonInstrInfo.cpp.
References llvm::is_TC4x(), and MI.
| bool HexagonInstrInfo::isTmpLoadPseudo | ( | const MachineInstr & | MI | ) | const |
Definition at line 3566 of file HexagonInstrInfo.cpp.
References MI.
Referenced by llvm::HexagonSubtarget::HLXPseudoMutation::apply().
| bool HexagonInstrInfo::isToBeScheduledASAP | ( | const MachineInstr & | MI1, |
| const MachineInstr & | MI2 ) const |
Definition at line 3059 of file HexagonInstrInfo.cpp.
References llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), I, llvm::MachineOperand::isReg(), mayBeCurLoad(), mayBeNewStore(), and N.
Referenced by llvm::HexagonSubtarget::adjustSchedDependency().
Definition at line 3087 of file HexagonInstrInfo.cpp.
References llvm::Count, llvm::EVT::getSimpleVT(), llvm::EVT::getSizeInBits(), llvm::isInt(), llvm_unreachable, llvm::Offset, llvm::MVT::SimpleTy, and llvm::Size.
Definition at line 3124 of file HexagonInstrInfo.cpp.
References assert(), llvm::dbgs(), getName(), Hexagon_ADDI_OFFSET_MAX, Hexagon_ADDI_OFFSET_MIN, Hexagon_MEMB_OFFSET_MAX, Hexagon_MEMB_OFFSET_MIN, Hexagon_MEMD_OFFSET_MAX, Hexagon_MEMD_OFFSET_MIN, Hexagon_MEMH_OFFSET_MAX, Hexagon_MEMH_OFFSET_MIN, Hexagon_MEMW_OFFSET_MAX, Hexagon_MEMW_OFFSET_MIN, llvm::isInt(), llvm::isPowerOf2_32(), llvm::isShiftedInt(), llvm::isShiftedUInt(), llvm::isUInt(), llvm_unreachable, llvm::Log2_32(), and llvm::Offset.
| bool HexagonInstrInfo::isVecAcc | ( | const MachineInstr & | MI | ) | const |
Definition at line 3339 of file HexagonInstrInfo.cpp.
References isAccumulator(), isHVXVec(), and MI.
Referenced by isVecUsableNextPacket().
| bool HexagonInstrInfo::isVecALU | ( | const MachineInstr & | MI | ) | const |
Definition at line 3343 of file HexagonInstrInfo.cpp.
References F, llvm::get(), MI, llvm::HexagonII::TypeCVI_VA, llvm::HexagonII::TypeCVI_VA_DV, llvm::HexagonII::TypeMask, and llvm::HexagonII::TypePos.
Referenced by isVecUsableNextPacket().
| bool HexagonInstrInfo::isVecUsableNextPacket | ( | const MachineInstr & | ProdMI, |
| const MachineInstr & | ConsMI ) const |
Definition at line 3351 of file HexagonInstrInfo.cpp.
References EnableACCForwarding, EnableALUForwarding, isLateSourceInstr(), isVecAcc(), isVecALU(), and mayBeNewStore().
Referenced by addLatencyToSchedule(), and producesStall().
| bool HexagonInstrInfo::isZeroExtendingLoad | ( | const MachineInstr & | MI | ) | const |
Definition at line 3365 of file HexagonInstrInfo.cpp.
References MI.
|
override |
Load the specified register of the given register class from the specified stack frame index.
The load instruction is to be added to the given machine basic block before the specified machine instruction.
Definition at line 1051 of file HexagonInstrInfo.cpp.
References llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMemOperand(), llvm::BuildMI(), DL, llvm::get(), llvm::MachinePointerInfo::getFixedStack(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineFrameInfo::getObjectAlign(), llvm::MachineFrameInfo::getObjectSize(), I, llvm_unreachable, MBB, and llvm::MachineMemOperand::MOLoad.
| bool HexagonInstrInfo::mayBeCurLoad | ( | const MachineInstr & | MI | ) | const |
Definition at line 3551 of file HexagonInstrInfo.cpp.
References F, llvm::HexagonII::mayCVLoadMask, llvm::HexagonII::mayCVLoadPos, and MI.
Referenced by isToBeScheduledASAP().
| bool HexagonInstrInfo::mayBeNewStore | ( | const MachineInstr & | MI | ) | const |
Definition at line 3558 of file HexagonInstrInfo.cpp.
References F, llvm::HexagonII::mayNVStoreMask, llvm::HexagonII::mayNVStorePos, and MI.
Referenced by canExecuteInBundle(), isToBeScheduledASAP(), and isVecUsableNextPacket().
| void HexagonInstrInfo::moveDependentDebugValues | ( | MachineInstr & | First, |
| MachineInstr & | Second ) const |
Copies the debug values of the variables that read the register First and Second define to just after Second, in their original order, and sets each dependent original undef.
If a copy would read a value that changes in between, nothing is copied and only the originals are set undef.
Call this before the replacement for First and Second is created, and insert the replacement before Second. The replacement must not write a register the copies read, unless First or Second writes it too.
Definition at line 5332 of file HexagonInstrInfo.cpp.
References canMoveDebugValue(), llvm::First, llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineInstr::getParent(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::is_contained(), llvm::MachineInstr::isTerminator(), llvm::make_range(), MBB, MI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and TRI.
| unsigned HexagonInstrInfo::nonDbgBBSize | ( | const MachineBasicBlock * | BB | ) | const |
getInstrTimingClassLatency - Compute the instruction latency of a given instruction using Timing Class information, if available.
Definition at line 5006 of file HexagonInstrInfo.cpp.
References llvm::MachineBasicBlock::instr_begin(), llvm::MachineBasicBlock::instr_end(), and nonDbgMICount().
Referenced by isProfitableToIfCvt(), and isProfitableToIfCvt().
| unsigned HexagonInstrInfo::nonDbgBundleSize | ( | MachineBasicBlock::const_iterator | BundleHead | ) | const |
Definition at line 5010 of file HexagonInstrInfo.cpp.
References assert(), llvm::getBundleEnd(), llvm::MachineInstrBundleIterator< Ty, IsReverse >::getInstrIterator(), and nonDbgMICount().
| bool HexagonInstrInfo::predCanBeUsedAsDotNew | ( | const MachineInstr & | MI, |
| Register | PredReg ) const |
Definition at line 3612 of file HexagonInstrInfo.cpp.
References MI.
|
override |
Convert the instruction into a predicated instruction.
It returns true if the operation was successful.
Definition at line 1784 of file HexagonInstrInfo.cpp.
References AbstractManglingParser< Derived, Alloc >::NumOps, assert(), B(), llvm::BuildMI(), Cond, llvm::dbgs(), DL, llvm::get(), getCondOpcode(), llvm::getImm(), getPredReg(), isEndLoopN(), isNewValueJump(), isPredicable(), LLVM_DEBUG, MI, MRI, Opc, predOpcodeHasNot(), and T.
Definition at line 3647 of file HexagonInstrInfo.cpp.
Referenced by analyzeBranch().
| bool HexagonInstrInfo::predOpcodeHasNot | ( | ArrayRef< MachineOperand > | Cond | ) | const |
Definition at line 3658 of file HexagonInstrInfo.cpp.
References Cond, llvm::getImm(), isPredicated(), and isPredicatedTrue().
Referenced by PredicateInstruction().
| bool HexagonInstrInfo::producesStall | ( | const MachineInstr & | MI, |
| MachineBasicBlock::const_instr_iterator | MII ) const |
Definition at line 3592 of file HexagonInstrInfo.cpp.
References isHVXVec(), MI, and producesStall().
| bool HexagonInstrInfo::producesStall | ( | const MachineInstr & | ProdMI, |
| const MachineInstr & | ConsMI ) const |
Definition at line 3574 of file HexagonInstrInfo.cpp.
References isDependent(), isHVXVec(), and isVecUsableNextPacket().
Referenced by producesStall().
|
override |
Remove the branching code at the end of the specific MBB.
This is only invoked in cases where analyzeBranch returns success. It returns the number of instructions that were removed.
Definition at line 610 of file HexagonInstrInfo.cpp.
References assert(), llvm::Count, llvm::dbgs(), I, LLVM_DEBUG, llvm_unreachable, MBB, and llvm::printMBBReference().
Referenced by insertBranch().
|
override |
Reverses the branch condition of the specified condition list, returning false on success and true if it cannot be reversed.
Definition at line 1739 of file HexagonInstrInfo.cpp.
References assert(), Cond, llvm::get(), getInvertedPredicatedOpcode(), isBranch(), and isEndLoopN().
Referenced by insertBranch().
Definition at line 5083 of file HexagonInstrInfo.cpp.
References assert(), and isPredictedTaken().
Referenced by invertAndChangeJumpTarget().
| bool HexagonInstrInfo::reversePredSense | ( | MachineInstr & | MI | ) | const |
Definition at line 5076 of file HexagonInstrInfo.cpp.
References llvm::dbgs(), llvm::get(), getInvertedPredicatedOpcode(), LLVM_DEBUG, and MI.
| void HexagonInstrInfo::setBundleNoShuf | ( | MachineBasicBlock::instr_iterator | MIB | ) | const |
Definition at line 5099 of file HexagonInstrInfo.cpp.
References assert(), llvm::MachineOperand::CreateImm(), llvm::MachineOperand::getImm(), llvm::MachineOperand::isImm(), and llvm::MachineOperand::setImm().
|
override |
Definition at line 187 of file HexagonInstrInfo.cpp.
|
override |
Store the specified register of the given register class to the specified stack frame index.
The store instruction is to be added to the given machine basic block before the specified machine instruction. If isKill is true, the register operand is the last use and must be marked kill.
Definition at line 979 of file HexagonInstrInfo.cpp.
References llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMemOperand(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), DL, llvm::get(), llvm::MachinePointerInfo::getFixedStack(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::getKillRegState(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineFrameInfo::getObjectAlign(), llvm::MachineFrameInfo::getObjectSize(), I, llvm_unreachable, MBB, and llvm::MachineMemOperand::MOStore.
|
override |
Returns true if the first specified predicate subsumes the second, e.g.
GE subsumes GT.
Definition at line 1837 of file HexagonInstrInfo.cpp.
| void HexagonInstrInfo::translateInstrsForDup | ( | MachineBasicBlock::instr_iterator | MII, |
| bool | ToBigInstrs ) const |
Definition at line 4858 of file HexagonInstrInfo.cpp.
References changeDuplexOpcode(), and MBB.
| void HexagonInstrInfo::translateInstrsForDup | ( | MachineFunction & | MF, |
| bool | ToBigInstrs = true ) const |
Definition at line 4848 of file HexagonInstrInfo.cpp.
References changeDuplexOpcode(), and llvm::End.
|
inlineoverride |
Definition at line 556 of file HexagonInstrInfo.h.
| bool HexagonInstrInfo::usesQF16Operand | ( | MachineInstr * | MI, |
| unsigned | Index = 0 ) const |
Definition at line 5260 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::getRegTypeInfo(), MI, and llvm::HexagonII::QF16.
Referenced by usesQFOperand().
| bool HexagonInstrInfo::usesQF32Operand | ( | MachineInstr * | MI, |
| unsigned | Index = 0 ) const |
Definition at line 5241 of file HexagonInstrInfo.cpp.
References llvm::HexagonII::getRegTypeInfo(), MI, and llvm::HexagonII::QF32.
Referenced by usesQFOperand().
| bool HexagonInstrInfo::usesQFOperand | ( | MachineInstr * | MI, |
| unsigned | Index = 0 ) const |
Definition at line 5279 of file HexagonInstrInfo.cpp.
References MI, usesQF16Operand(), and usesQF32Operand().
| bool HexagonInstrInfo::validateBranchCond | ( | const ArrayRef< MachineOperand > & | Cond | ) | const |
Definition at line 5094 of file HexagonInstrInfo.cpp.
References Cond.
Referenced by insertBranch().