|
LLVM 24.0.0git
|
#include "Target/RISCV/RISCVInstrInfo.h"
Static Public Member Functions | |
| static bool | isSafeToMove (const MachineInstr &From, const MachineBasicBlock::iterator &To) |
Return true if moving From down to To won't cause any physical register reads or writes to be clobbered and no visible side effects are affected. | |
| static bool | isPairableLdStInstOpc (unsigned Opc) |
| Return true if pairing the given load or store may be paired with another. | |
| static bool | isLdStSafeToPair (const MachineInstr &LdSt, const TargetRegisterInfo *TRI) |
| static RISCVCC::CondCode | getCondFromBranchOpc (unsigned Opc) |
| static bool | evaluateCondBranch (RISCVCC::CondCode CC, int64_t C0, int64_t C1) |
| Return the result of the evaluation of C0 CC C1, where CC is a RISCVCC::CondCode. | |
| static bool | isFromLoadImm (const MachineRegisterInfo &MRI, const MachineOperand &Op, int64_t &Imm) |
| Return true if the operand is a load immediate instruction and sets Imm to the immediate value. | |
Protected Attributes | |
| const RISCVSubtarget & | STI |
Definition at line 81 of file RISCVInstrInfo.h.
|
explicit |
Definition at line 88 of file RISCVInstrInfo.cpp.
References STI.
|
override |
Definition at line 1376 of file RISCVInstrInfo.cpp.
References Cond, getBranchDestBlock(), llvm::MachineInstrBundleIterator< Ty, IsReverse >::getReverse(), I, MBB, parseCondBranch(), and TBB.
Referenced by analyzeLoopForPipelining().
| bool RISCVInstrInfo::analyzeCandidate | ( | outliner::Candidate & | C | ) | const |
Definition at line 3741 of file RISCVInstrInfo.cpp.
References assert(), C(), cannotInsertTailCall(), llvm::dbgs(), findRegisterToSaveX5To(), llvm::RISCVII::getTailExpandUseRegNo(), LLVM_DEBUG, OutlinerEnableRegSave, and STI.
Referenced by getOutliningCandidateInfo().
|
override |
Definition at line 5403 of file RISCVInstrInfo.cpp.
References analyzeBranch(), assert(), Cond, llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm::MachineRegisterInfo::getVRegDef(), reverseBranchCondition(), and TBB.
|
override |
Definition at line 3576 of file RISCVInstrInfo.cpp.
References assert(), getMemOperandWithOffsetWidth(), llvm::LocationSize::getValue(), llvm::MachineInstr::hasOrderedMemoryRef(), llvm::MachineInstr::hasUnmodeledSideEffects(), llvm::LocationSize::hasValue(), llvm::MachineOperand::isIdenticalTo(), llvm::MachineInstr::mayLoadOrStore(), llvm::LocationSize::precise(), STI, and TRI.
|
override |
Definition at line 3970 of file RISCVInstrInfo.cpp.
References llvm::BuildMI(), contains(), DL, llvm::get(), MBB, llvm::reportFatalInternalError(), STI, and TRI.
|
override |
Definition at line 3909 of file RISCVInstrInfo.cpp.
References llvm::BuildMI(), llvm::dwarf_linker::DebugLoc, llvm::Define, llvm::get(), MachineOutlinerTailCall, and MBB.
|
override |
Definition at line 3332 of file RISCVInstrInfo.cpp.
References llvm::ExtAddrMode::BaseReg, llvm::ExtAddrMode::Basic, llvm::ExtAddrMode::Displacement, llvm::ExtAddrMode::Form, llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isImm(), llvm::isInt(), llvm::MachineOperand::isReg(), llvm::ExtAddrMode::Scale, llvm::ExtAddrMode::ScaledReg, llvm::SignExtend64(), and STI.
|
override |
Definition at line 4419 of file RISCVInstrInfo.cpp.
References assert(), CASE_VFMA_CHANGE_OPCODE_SPLATS, CASE_VFMA_CHANGE_OPCODE_VV, CASE_VFMA_OPCODE_VV, CASE_VFMA_SPLATS, CASE_VMA_CHANGE_OPCODE_LMULS, CASE_VMA_OPCODE_LMULS, llvm::TargetInstrInfo::commuteInstructionImpl(), llvm::FMSUB, llvm::FNMADD, llvm::FNMSUB, llvm::get(), llvm::RISCVCC::getInverseBranchOpcode(), getInverseXqcicmOpcode(), llvm_unreachable, MI, and Opc.
|
override |
Definition at line 4892 of file RISCVInstrInfo.cpp.
References AbstractManglingParser< Derived, Alloc >::NumOps, llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), CASE_FP_WIDEOP_CHANGE_OPCODE_LMULS, CASE_FP_WIDEOP_CHANGE_OPCODE_LMULS_ALT, CASE_FP_WIDEOP_OPCODE_LMULS, CASE_FP_WIDEOP_OPCODE_LMULS_ALT, CASE_WIDEOP_CHANGE_OPCODE_LMULS, CASE_WIDEOP_OPCODE_LMULS, llvm::MachineInstrBuilder::copyImplicitOps(), llvm::LiveRange::Segment::end, llvm::get(), llvm::LiveIntervals::getInterval(), llvm::SlotIndex::getRegSlot(), llvm::LiveRange::getSegmentContaining(), llvm::RISCVII::getVecPolicyOpNum(), llvm::RISCVII::hasVecPolicyOp(), I, llvm_unreachable, MBB, MI, llvm::LiveVariables::replaceKillInstruction(), llvm::LiveIntervals::ReplaceMachineInstrInMaps(), and llvm::Undef.
|
override |
Definition at line 510 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), contains(), copyPhysRegVector(), DL, llvm::get(), llvm::getKillRegState(), llvm::getRenamableRegState(), llvm::RISCVRegisterInfo::isRVVRegClass(), llvm_unreachable, MBB, MBBI, Opc, STI, and TRI.
| void RISCVInstrInfo::copyPhysRegVector | ( | MachineBasicBlock & | MBB, |
| MachineBasicBlock::iterator | MBBI, | ||
| const DebugLoc & | DL, | ||
| MCRegister | DstReg, | ||
| MCRegister | SrcReg, | ||
| bool | KillSrc, | ||
| const TargetRegisterClass * | RegClass ) const |
Definition at line 387 of file RISCVInstrInfo.cpp.
References _, assert(), llvm::BuildMI(), llvm::RISCVVType::decodeVLMUL(), DL, forwardCopyWillClobberTuple(), llvm::get(), llvm::getKillRegState(), llvm::RISCVRI::getLMul(), llvm::RISCVRI::getNF(), llvm::RISCV::getRVVMCOpcode(), llvm::RISCVII::getSEWOpNum(), llvm::RISCVII::getVLOpNum(), I, llvm::Implicit, isConvertibleToVMV_V_V(), llvm::RISCVVType::LMUL_1, llvm::RISCVVType::LMUL_2, llvm::RISCVVType::LMUL_4, llvm::RISCVVType::LMUL_8, MBB, MBBI, Opc, STI, TRI, llvm::MCRegisterClass::TSFlags, and llvm::Undef.
Referenced by copyPhysReg().
|
override |
Definition at line 4012 of file RISCVInstrInfo.cpp.
References assert(), llvm::TargetInstrInfo::createMIROperandComment(), Imm, llvm::RISCVFPRndMode::isValidRoundingMode(), llvm::RISCVVXRndMode::isValidRoundingMode(), llvm::RISCVVType::isValidSEW(), llvm::RISCVVType::MASK_AGNOSTIC, MI, llvm::RISCVOp::OPERAND_AVL, llvm::RISCVOp::OPERAND_SEW, llvm::RISCVOp::OPERAND_SEW_MASK, llvm::RISCVOp::OPERAND_VEC_POLICY, llvm::RISCVOp::OPERAND_VEC_RM, llvm::RISCVOp::OPERAND_VTYPEI10, llvm::RISCVOp::OPERAND_VTYPEI11, llvm::RISCVOp::OPERAND_XSFMM_TWIDEN, llvm::RISCVOp::OPERAND_XSFMM_VTYPE, llvm::RISCVVType::printVType(), llvm::RISCVVType::printXSfmmVType(), llvm::RISCVFPRndMode::roundingModeToString(), llvm::RISCVVXRndMode::roundingModeToString(), llvm::RISCVVType::TAIL_AGNOSTIC, TRI, and llvm::RISCVII::usesVXRM().
|
override |
Definition at line 3610 of file RISCVInstrInfo.cpp.
References llvm::RISCVII::MO_DIRECT_FLAG_MASK.
|
override |
Definition at line 3388 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::ExtAddrMode::BaseReg, llvm::BuildMI(), llvm::ExtAddrMode::Displacement, DL, llvm::get(), llvm::MachineInstr::getDebugLoc(), llvm::getDefRegState(), llvm::MachineInstr::getFlags(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineInstr::mayLoad(), MBB, llvm::MachineInstr::memoperands(), llvm::ExtAddrMode::Scale, llvm::ExtAddrMode::ScaledReg, llvm::MachineInstrBuilder::setMemRefs(), and llvm::MachineInstrBuilder::setMIFlags().
|
static |
Return the result of the evaluation of C0 CC C1, where CC is a RISCVCC::CondCode.
Definition at line 1121 of file RISCVInstrInfo.cpp.
References llvm::RISCVCC::COND_EQ, llvm::RISCVCC::COND_GE, llvm::RISCVCC::COND_GEU, llvm::RISCVCC::COND_LT, llvm::RISCVCC::COND_LTU, llvm::RISCVCC::COND_NE, and llvm_unreachable.
Referenced by INITIALIZE_PASS(), and optimizeCondBranch().
|
override |
Definition at line 2212 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addUse(), llvm::all_of(), assert(), llvm::RISCVFPRndMode::DYN, llvm::MachineOperand::getImm(), llvm::MachineInstr::getMF(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::Implicit, and MI.
|
override |
Definition at line 4175 of file RISCVInstrInfo.cpp.
References assert(), CASE_RVV_OPCODE, CASE_RVV_OPCODE_LMUL, CASE_RVV_OPCODE_MASK, CASE_RVV_OPCODE_UNMASK, CASE_RVV_OPCODE_WIDEN, CASE_VFMA_OPCODE_VV, CASE_VFMA_SPLATS, CASE_VMA_OPCODE_LMULS, llvm::TargetInstrInfo::findCommutedOpIndices(), llvm::FMSUB, llvm::FNMADD, llvm::FNMSUB, llvm::RISCVII::getVecPolicyOpNum(), llvm::RISCVII::hasVecPolicyOp(), llvm::M1(), and MI.
|
override |
Definition at line 921 of file RISCVInstrInfo.cpp.
References AbstractManglingParser< Derived, Alloc >::Ops, llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::BuildMI(), llvm::get(), getFoldedOpcode(), MI, and STI.
|
override |
Definition at line 967 of file RISCVInstrInfo.cpp.
References AbstractManglingParser< Derived, Alloc >::Ops, llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), llvm::BuildMI(), llvm::MachineInstrBuilder::cloneMemRefs(), llvm::MachineRegisterInfo::constrainRegClass(), llvm::get(), llvm::MachineInstr::getDesc(), llvm::RISCVCC::getInverseBranchOpcode(), getLoadPredicatedOpcode(), llvm::MCInstrDesc::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), MI, and STI.
|
override |
Definition at line 2956 of file RISCVInstrInfo.cpp.
References combineFPFusedMultiply(), llvm::FMADD_AX, llvm::FMADD_XA, llvm::FMSUB, llvm::FNMSUB, llvm::TargetInstrInfo::genAlternativeCodeSequence(), genShXAddAddShift(), llvm::MachineInstr::getMF(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::MachineRegisterInfo::getVRegDef(), llvm::SHXADD_ADD_SLLI_OP1, and llvm::SHXADD_ADD_SLLI_OP2.
|
override |
Definition at line 1768 of file RISCVInstrInfo.cpp.
Referenced by analyzeBranch().
|
override |
Definition at line 2791 of file RISCVInstrInfo.cpp.
References llvm::FMADD_AX, llvm::FMADD_XA, llvm::FMSUB, llvm::FNMSUB, llvm::TargetInstrInfo::getCombinerObjective(), and llvm::MustReduceDepth.
|
static |
Definition at line 1082 of file RISCVInstrInfo.cpp.
References llvm::RISCVCC::COND_EQ, llvm::RISCVCC::COND_GE, llvm::RISCVCC::COND_GEU, llvm::RISCVCC::COND_INVALID, llvm::RISCVCC::COND_LT, llvm::RISCVCC::COND_LTU, llvm::RISCVCC::COND_NE, and Opc.
Referenced by INITIALIZE_PASS(), and optimizeCondBranch().
|
override |
Definition at line 1991 of file RISCVInstrInfo.cpp.
References F, llvm::get(), llvm::MachineFunction::getFunction(), llvm::TargetMachine::getMCAsmInfo(), llvm::PatchPointOpers::getNumPatchBytes(), llvm::StackMapOpers::getNumPatchBytes(), llvm::StatepointOpers::getNumPatchBytes(), llvm::MachineFunction::getTarget(), MI, requiresNTLHint(), and STI.
Referenced by getOutliningCandidateInfo(), insertBranch(), and removeBranch().
Definition at line 2573 of file RISCVInstrInfo.cpp.
References RVV_OPC_LMUL_CASE, and RVV_OPC_LMUL_MASK_CASE.
Referenced by isAssociativeAndCommutative().
|
override |
Definition at line 2803 of file RISCVInstrInfo.cpp.
References getFPPatterns(), llvm::TargetInstrInfo::getMachineCombinerPatterns(), and getSHXADDPatterns().
|
override |
Definition at line 2198 of file RISCVInstrInfo.cpp.
References ForceMachineCombinerStrategy, STI, llvm::TS_Local, and llvm::TS_MinInstrCount.
|
override |
Definition at line 3441 of file RISCVInstrInfo.cpp.
References getMemOperandWithOffsetWidth(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::mayLoadOrStore(), llvm::Offset, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and TRI.
| bool RISCVInstrInfo::getMemOperandWithOffsetWidth | ( | const MachineInstr & | LdSt, |
| const MachineOperand *& | BaseOp, | ||
| int64_t & | Offset, | ||
| LocationSize & | Width, | ||
| const TargetRegisterInfo * | TRI ) const |
Definition at line 3552 of file RISCVInstrInfo.cpp.
References llvm::MachineOperand::getImm(), llvm::MachineInstr::getNumExplicitOperands(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::hasOneMemOperand(), llvm::MachineOperand::isFI(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isReg(), llvm::MachineInstr::mayLoadOrStore(), llvm::MachineInstr::memoperands_begin(), llvm::Offset, and TRI.
Referenced by areMemAccessesTriviallyDisjoint(), and getMemOperandsWithOffsetWidth().
|
override |
Definition at line 96 of file RISCVInstrInfo.cpp.
References llvm::MCInstBuilder::addImm(), llvm::MCInstBuilder::addReg(), and STI.
|
override |
Definition at line 3783 of file RISCVInstrInfo.cpp.
References analyzeCandidate(), llvm::outliner::Candidate::back(), C(), llvm::erase_if(), getInstSizeInBytes(), llvm::outliner::Candidate::getMF(), llvm::MachineFunction::getSubtarget(), I, llvm::MachineInstr::isReturn(), MachineOutlinerDefault, MachineOutlinerRegSave, MachineOutlinerTailCall, MI, and OutlinerEnableRegSave.
|
override |
Definition at line 3873 of file RISCVInstrInfo.cpp.
References cannotInsertTailCall(), F, llvm::outliner::Illegal, isMIModifiesReg(), llvm::outliner::Legal, MBB, MBBI, MI, llvm::RISCVII::MO_PCREL_LO, and TRI.
|
override |
Definition at line 2483 of file RISCVInstrInfo.cpp.
References llvm::MachineInstr::getOpcode(), llvm::TargetInstrInfo::getReassociateOperandIndices(), llvm::RISCV::getRVVMCOpcode(), and I.
|
inline |
Definition at line 87 of file RISCVInstrInfo.h.
|
override |
Definition at line 3616 of file RISCVInstrInfo.cpp.
References llvm::ArrayRef().
|
override |
Definition at line 5111 of file RISCVInstrInfo.cpp.
References llvm::ArrayRef(), llvm::MONontemporalBit0, and llvm::MONontemporalBit1.
|
override |
Definition at line 5118 of file RISCVInstrInfo.cpp.
References llvm::Aggressive, and STI.
|
override |
Definition at line 2460 of file RISCVInstrInfo.cpp.
References llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getUniqueVRegDef(), llvm::TargetInstrInfo::hasReassociableOperands(), llvm::MachineOperand::isReg(), llvm::Register::isVirtual(), and MBB.
|
override |
Definition at line 2494 of file RISCVInstrInfo.cpp.
References llvm::MachineInstr::getMF(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::MachineRegisterInfo::getVRegDef(), llvm::RISCV::hasEqualFRM(), and llvm::TargetInstrInfo::hasReassociableSibling().
|
override |
Definition at line 1482 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addMBB(), assert(), llvm::BuildMI(), Cond, DL, llvm::get(), llvm::getImm(), getInstSizeInBytes(), MBB, MI, and TBB.
|
override |
Definition at line 1520 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::MachineBasicBlock::back(), llvm::BuildMI(), llvm::MachineRegisterInfo::clearVirtRegs(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::Dead, llvm::Define, DL, llvm::MachineBasicBlock::empty(), llvm::MachineBasicBlock::end(), llvm::get(), llvm::RISCVMachineFunctionInfo::getBranchRelaxationScratchFrameIndex(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), II, llvm::isInt(), llvm::Register::isValid(), loadRegFromStackSlot(), MBB, MI, llvm::RISCVII::MO_CALL, Register, llvm::MachineRegisterInfo::replaceRegWith(), llvm::report_fatal_error(), STI, storeRegToStackSlot(), and TRI.
|
override |
Definition at line 3925 of file RISCVInstrInfo.cpp.
References assert(), llvm::BuildMI(), C(), llvm::dwarf_linker::DebugLoc, findRegisterToSaveX5To(), llvm::get(), llvm::MachineFunction::getName(), MachineOutlinerRegSave, MachineOutlinerTailCall, MBB, and llvm::RISCVII::MO_CALL.
|
override |
Definition at line 3994 of file RISCVInstrInfo.cpp.
References llvm::MachineOperand::getReg(), llvm::MachineOperand::isReg(), and MI.
|
override |
Definition at line 2119 of file RISCVInstrInfo.cpp.
References MI.
|
override |
Definition at line 2517 of file RISCVInstrInfo.cpp.
References llvm::MachineInstr::FmNsz, llvm::MachineInstr::FmReassoc, llvm::MachineInstr::getFlag(), getInverseOpcode(), llvm::MachineInstr::getOpcode(), isFADD(), isFMUL(), and Opc.
Definition at line 1775 of file RISCVInstrInfo.cpp.
References llvm::isInt(), llvm_unreachable, llvm::SignExtend64(), and STI.
|
override |
Definition at line 2145 of file RISCVInstrInfo.cpp.
References MI.
|
static |
Return true if the operand is a load immediate instruction and sets Imm to the immediate value.
Definition at line 1623 of file RISCVInstrInfo.cpp.
References DefMI, llvm::MachineRegisterInfo::getVRegDef(), Imm, and isLoadImm().
Referenced by INITIALIZE_PASS(), and optimizeCondBranch().
|
override |
Definition at line 3638 of file RISCVInstrInfo.cpp.
References F, and llvm::MachineFunction::getFunction().
|
override |
Definition at line 5445 of file RISCVInstrInfo.cpp.
References llvm::RISCV::getRVVMCOpcode(), and Opc.
|
static |
Definition at line 3420 of file RISCVInstrInfo.cpp.
References assert(), llvm::MachineInstr::getNumExplicitOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineInstr::hasOrderedMemoryRef(), llvm::MachineOperand::isFI(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isReg(), llvm::MachineInstr::modifiesRegister(), and TRI.
|
override |
Definition at line 105 of file RISCVInstrInfo.cpp.
References llvm::TypeSize::getZero(), isLoadFromStackSlot(), and MI.
Referenced by isLoadFromStackSlot().
|
override |
Definition at line 142 of file RISCVInstrInfo.cpp.
References llvm::TypeSize::getFixed(), getLMULForRVVWholeLoadStore(), llvm::TypeSize::getScalable(), MI, Register, and llvm::RISCV::RVVBytesPerBlock.
|
override |
Definition at line 3655 of file RISCVInstrInfo.cpp.
References llvm::TargetInstrInfo::isMBBSafeToOutlineFrom(), and MBB.
Return true if pairing the given load or store may be paired with another.
Definition at line 3408 of file RISCVInstrInfo.cpp.
References Opc.
|
override |
Definition at line 241 of file RISCVInstrInfo.cpp.
References llvm::RISCV::getRVVMCOpcode(), llvm::TargetInstrInfo::isReMaterializableImpl(), and MI.
|
static |
Return true if moving From down to To won't cause any physical register reads or writes to be clobbered and no visible side effects are affected.
From and To must be in the same block.
Definition at line 5529 of file RISCVInstrInfo.cpp.
References llvm::MachineInstr::all_defs(), llvm::MachineInstr::all_uses(), assert(), llvm::MachineBasicBlock::end(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineInstr::getParent(), II, llvm::MachineInstr::isSafeToMove(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
override |
Definition at line 190 of file RISCVInstrInfo.cpp.
References llvm::TypeSize::getZero(), isStoreToStackSlot(), and MI.
Referenced by isStoreToStackSlot().
|
override |
Definition at line 196 of file RISCVInstrInfo.cpp.
References llvm::TypeSize::getFixed(), getLMULForRVVWholeLoadStore(), llvm::TypeSize::getScalable(), MI, Register, and llvm::RISCV::RVVBytesPerBlock.
| bool RISCVInstrInfo::isVRegCopy | ( | const MachineInstr * | MI, |
| unsigned | LMul = 0 ) const |
Return true if MI is a COPY to a vector register of a specific LMul, or any kind of vector registers when LMul is zero.
Definition at line 5494 of file RISCVInstrInfo.cpp.
References llvm::RISCVVType::decodeVLMUL(), llvm::RISCVRI::getLMul(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineRegisterInfo::getTargetRegisterInfo(), llvm::RISCVRegisterInfo::isRVVRegClass(), llvm::Register::isVirtual(), MI, TRI, and llvm::MCRegisterClass::TSFlags.
|
override |
Definition at line 760 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMemOperand(), llvm::BuildMI(), llvm::dwarf_linker::DebugLoc, DL, llvm::MachineInstr::FrameDestroy, llvm::get(), llvm::MachinePointerInfo::getFixedStack(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineFrameInfo::getObjectAlign(), llvm::MachineFrameInfo::getObjectSize(), llvm::TypeSize::getScalable(), I, llvm::RISCVRegisterInfo::isRVVRegClass(), llvm_unreachable, MBB, llvm::MachineMemOperand::MOLoad, llvm::RISCV::RVVBitsPerBlock, llvm::TargetStackID::ScalableVector, llvm::MachineInstrBuilder::setMIFlag(), llvm::MachineFrameInfo::setStackID(), and STI.
Referenced by insertIndirectBranch().
| void RISCVInstrInfo::movImm | ( | MachineBasicBlock & | MBB, |
| MachineBasicBlock::iterator | MBBI, | ||
| const DebugLoc & | DL, | ||
| Register | DstReg, | ||
| uint64_t | Val, | ||
| MachineInstr::MIFlag | Flag = MachineInstr::NoFlags, | ||
| bool | DstRenamable = false, | ||
| bool | DstIsDead = false ) const |
Definition at line 1017 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::Define, DL, llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::RISCVMatInt::generateInstSeq(), llvm::get(), llvm::getDeadRegState(), llvm::getKillRegState(), llvm::getRenamableRegState(), llvm::RISCVMatInt::Imm, llvm::isInt(), llvm::isUInt(), MBB, MBBI, llvm::RISCVMatInt::RegImm, llvm::RISCVMatInt::RegReg, llvm::RISCVMatInt::RegX0, llvm::report_fatal_error(), llvm::MachineInstrBuilder::setMIFlag(), llvm::SignExtend64(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and STI.
Referenced by llvm::RISCVRegisterInfo::lowerSegmentSpillReload(), and mulImm().
| void RISCVInstrInfo::mulImm | ( | MachineFunction & | MF, |
| MachineBasicBlock & | MBB, | ||
| MachineBasicBlock::iterator | II, | ||
| const DebugLoc & | DL, | ||
| Register | DestReg, | ||
| uint32_t | Amt, | ||
| MachineInstr::MIFlag | Flag ) const |
Generate code to multiply the value in DestReg by Amt - handles all the common optimizations for this idiom, and supports fallback for subtargets which don't support multiply instructions.
Definition at line 5006 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), DL, llvm::get(), llvm::MachineFunction::getRegInfo(), llvm::has_single_bit(), II, llvm::isShifted359(), llvm::Kill, llvm_unreachable, llvm::Log2_32(), MBB, movImm(), N, Opc, llvm::MachineInstrBuilder::setMIFlag(), and STI.
|
override |
Definition at line 1642 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::MachineRegisterInfo::clearKillFlags(), llvm::RISCVCC::COND_INVALID, evaluateCondBranch(), llvm::get(), llvm::RISCVCC::getBrCond(), getCondFromBranchOpc(), llvm::MachineRegisterInfo::hasOneUse(), I, II, Imm, isFromLoadImm(), llvm::isInt(), isLoadImm(), MBB, MI, Register, and TBB.
|
override |
Definition at line 1926 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), assert(), llvm::BuildMI(), canFoldAsPredicatedOp(), llvm::MachineInstr::clearKillInfo(), llvm::MachineRegisterInfo::constrainRegClass(), DefMI, llvm::SmallPtrSetImpl< PtrType >::erase(), llvm::get(), llvm::RISCVCC::getInverseBranchOpcode(), llvm::MCInstrDesc::getNumOperands(), getPredicatedOpcode(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getRegClass(), llvm::SmallPtrSetImpl< PtrType >::insert(), MI, and STI.
|
override |
Definition at line 1448 of file RISCVInstrInfo.cpp.
References getInstSizeInBytes(), I, and MBB.
| bool RISCVInstrInfo::requiresNTLHint | ( | const MachineInstr & | MI | ) | const |
Return true if the instruction requires an NTL hint to be emitted.
Definition at line 5518 of file RISCVInstrInfo.cpp.
References llvm::MachineMemOperand::isNonTemporal(), and MI.
Referenced by getInstSizeInBytes().
|
override |
Definition at line 1595 of file RISCVInstrInfo.cpp.
References assert(), Cond, llvm::getImm(), and llvm::RISCVCC::getInverseBranchOpcode().
Referenced by analyzeLoopForPipelining().
|
inlineoverride |
Definition at line 102 of file RISCVInstrInfo.h.
References MI.
|
override |
Definition at line 3518 of file RISCVInstrInfo.cpp.
References CacheLineSize, llvm::ArrayRef< T >::empty(), llvm::ArrayRef< T >::front(), and memOpsHaveSameBasePtr().
|
override |
Definition at line 3668 of file RISCVInstrInfo.cpp.
References llvm::MachineFunction::getFunction(), and llvm::Function::hasMinSize().
|
override |
Definition at line 4584 of file RISCVInstrInfo.cpp.
References llvm::MachineOperand::CreateImm(), llvm::get(), getSHXADDShiftAmount(), getSHXADDUWShiftAmount(), MI, and Opc.
|
override |
Definition at line 670 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMemOperand(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::dwarf_linker::DebugLoc, llvm::get(), llvm::MachinePointerInfo::getFixedStack(), llvm::MachineFunction::getFrameInfo(), llvm::getKillRegState(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineFrameInfo::getObjectAlign(), llvm::MachineFrameInfo::getObjectSize(), llvm::TypeSize::getScalable(), I, llvm::RISCVRegisterInfo::isRVVRegClass(), llvm_unreachable, MBB, llvm::MachineMemOperand::MOStore, llvm::RISCV::RVVBitsPerBlock, llvm::TargetStackID::ScalableVector, llvm::MachineInstrBuilder::setMIFlag(), llvm::MachineFrameInfo::setStackID(), and STI.
Referenced by insertIndirectBranch().
|
inlineoverride |
Definition at line 291 of file RISCVInstrInfo.h.
|
override |
Definition at line 2988 of file RISCVInstrInfo.cpp.
References assert(), CASE_OPERAND_SIMM, CASE_OPERAND_UIMM, CASE_OPERAND_UIMM_LSB_ZEROS, llvm::RISCVCC::COND_INVALID, llvm::RISCVFPRndMode::DYN, llvm::enumerate(), llvm::RISCVII::getFRMOpNum(), llvm::getImm(), llvm::MachineOperand::getImm(), llvm::MachineRegisterInfo::getRegClass(), llvm::RISCVII::getSEWOpNum(), llvm::RISCVII::getVecPolicyOpNum(), llvm::RISCVII::getVLOpNum(), llvm::RISCVII::hasRoundModeOp(), llvm::RISCVII::hasSEWOp(), llvm::RISCVII::hasVecPolicyOp(), llvm::RISCVII::hasVLOp(), Imm, llvm::MachineOperand::isImm(), llvm::isInt(), llvm::MachineOperand::isReg(), llvm::isShiftedInt(), llvm::isShiftedUInt(), llvm::isUInt(), llvm::isValidAtomicOrdering(), llvm::RISCVFPRndMode::isValidRoundingMode(), llvm::RISCVVType::isValidSEW(), llvm::XSMTVTypeMode::isValidSMTVTypeMode(), llvm::RISCVVType::isValidVType(), llvm::RISCVVType::isValidXSfmmVType(), llvm::RISCV::isValidYBNDSWImm(), llvm_unreachable, llvm::RISCVVType::MASK_AGNOSTIC, MI, llvm::RISCVOp::OPERAND_ATOMIC_ORDERING, llvm::RISCVOp::OPERAND_AVL, llvm::RISCVOp::OPERAND_BARE_SIMM32, llvm::RISCVOp::OPERAND_CLUI_IMM, llvm::RISCVOp::OPERAND_COND_CODE, llvm::RISCVOp::OPERAND_FIRST_RISCV_IMM, llvm::RISCVOp::OPERAND_FOUR, llvm::RISCVOp::OPERAND_FRMARG, llvm::RISCVOp::OPERAND_IMM5_ZIBI, llvm::RISCVOp::OPERAND_LAST_RISCV_IMM, llvm::RISCVOp::OPERAND_RLIST, llvm::RISCVOp::OPERAND_RLIST_S0, llvm::RISCVOp::OPERAND_RTZARG, llvm::RISCVOp::OPERAND_RVKRNUM, llvm::RISCVOp::OPERAND_RVKRNUM_0_7, llvm::RISCVOp::OPERAND_RVKRNUM_1_10, llvm::RISCVOp::OPERAND_RVKRNUM_2_14, llvm::RISCVOp::OPERAND_SEW, llvm::RISCVOp::OPERAND_SEW_MASK, llvm::RISCVOp::OPERAND_SFB_RHS, llvm::RISCVOp::OPERAND_SIMM10_LSB0000_NONZERO, llvm::RISCVOp::OPERAND_SIMM12_LO, llvm::RISCVOp::OPERAND_SIMM12_LSB00000, llvm::RISCVOp::OPERAND_SIMM16_NONZERO, llvm::RISCVOp::OPERAND_SIMM20_LI, llvm::RISCVOp::OPERAND_SIMM5_NONZERO, llvm::RISCVOp::OPERAND_SIMM5_PLUS1, llvm::RISCVOp::OPERAND_SIMM6_NONZERO, llvm::RISCVOp::OPERAND_SMTI8, llvm::RISCVOp::OPERAND_SMTVType, llvm::RISCVOp::OPERAND_STACKADJ, llvm::RISCVOp::OPERAND_THREE, llvm::RISCVOp::OPERAND_UIMM10_LSB00_NONZERO, llvm::RISCVOp::OPERAND_UIMM16_NONZERO, llvm::RISCVOp::OPERAND_UIMM20_AUIPC, llvm::RISCVOp::OPERAND_UIMM20_LUI, llvm::RISCVOp::OPERAND_UIMM5_GT3, llvm::RISCVOp::OPERAND_UIMM5_NONZERO, llvm::RISCVOp::OPERAND_UIMM5_PLUS1, llvm::RISCVOp::OPERAND_UIMM6_PLUS1, llvm::RISCVOp::OPERAND_UIMM7_EQ_XLEN, llvm::RISCVOp::OPERAND_UIMM8_GE32, llvm::RISCVOp::OPERAND_UIMM9_YBNDSWI, llvm::RISCVOp::OPERAND_UIMMLOG2XLEN, llvm::RISCVOp::OPERAND_UIMMLOG2XLEN_NONZERO, llvm::RISCVOp::OPERAND_VEC_POLICY, llvm::RISCVOp::OPERAND_VEC_RM, llvm::RISCVOp::OPERAND_VTYPEI10, llvm::RISCVOp::OPERAND_VTYPEI11, llvm::RISCVOp::OPERAND_XSFMM_TWIDEN, llvm::RISCVOp::OPERAND_XSFMM_VTYPE, llvm::RISCVZC::RA, llvm::RISCVZC::RA_S0, llvm::RISCVZC::RA_S0_S11, llvm::RISCVFPRndMode::RTZ, llvm::XSMTVTypeMode::SMT_I8, STI, llvm::RISCVVType::TAIL_AGNOSTIC, and llvm::RISCVII::usesVXRM().
|
protected |
Definition at line 369 of file RISCVInstrInfo.h.
Referenced by analyzeCandidate(), areMemAccessesTriviallyDisjoint(), buildClearRegister(), canFoldIntoAddrMode(), copyPhysReg(), copyPhysRegVector(), foldMemoryOperandImpl(), foldMemoryOperandImpl(), getInstSizeInBytes(), getMachineCombinerTraceStrategy(), getNop(), getTailDuplicateSize(), insertIndirectBranch(), isBranchOffsetInRange(), loadRegFromStackSlot(), movImm(), mulImm(), optimizeSelect(), RISCVInstrInfo(), storeRegToStackSlot(), and verifyInstruction().