|
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 68 of file RISCVInstrInfo.cpp.
References STI.
|
override |
Definition at line 1356 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 3850 of file RISCVInstrInfo.cpp.
References assert(), C(), cannotInsertTailCall(), llvm::dbgs(), findRegisterToSaveX5To(), llvm::RISCVII::getTailExpandUseRegNo(), llvm::RISCVMachineFunctionInfo::hasCFProtectionBranch(), LLVM_DEBUG, and STI.
Referenced by getOutliningCandidateInfo().
|
override |
Definition at line 5509 of file RISCVInstrInfo.cpp.
References analyzeBranch(), assert(), Cond, llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm::MachineRegisterInfo::getVRegDef(), reverseBranchCondition(), and TBB.
|
override |
Definition at line 3679 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(), and llvm::LocationSize::precise().
|
override |
Definition at line 4086 of file RISCVInstrInfo.cpp.
References llvm::BuildMI(), contains(), DL, llvm::get(), MBB, llvm::reportFatalInternalError(), STI, and TRI.
|
override |
Definition at line 4022 of file RISCVInstrInfo.cpp.
References llvm::BuildMI(), llvm::dwarf_linker::DebugLoc, llvm::get(), MachineOutlinerTailCall, and MBB.
|
override |
Definition at line 3436 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 4535 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 5008 of file RISCVInstrInfo.cpp.
References 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::LiveRange::getSegmentContaining(), llvm::RISCVII::getVecPolicyOpNum(), llvm::RISCVII::hasVecPolicyOp(), llvm_unreachable, MBB, MI, llvm::LiveIntervals::ReplaceMachineInstrInMaps(), and llvm::Undef.
|
override |
Definition at line 490 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 367 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 4128 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, and llvm::RISCVII::usesVXRM().
|
override |
Definition at line 3712 of file RISCVInstrInfo.cpp.
References llvm::RISCVII::MO_DIRECT_FLAG_MASK.
|
override |
Definition at line 3492 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 1101 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 2316 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 4291 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 901 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 947 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 3060 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 1748 of file RISCVInstrInfo.cpp.
Referenced by analyzeBranch().
|
override |
Definition at line 2895 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 1062 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().
|
inlineoverride |
Definition at line 89 of file RISCVInstrInfo.h.
References C().
|
override |
Definition at line 2093 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(), Size, and STI.
Referenced by getOutliningCandidateInfo(), insertBranch(), and removeBranch().
Definition at line 2677 of file RISCVInstrInfo.cpp.
References RVV_OPC_LMUL_CASE, and RVV_OPC_LMUL_MASK_CASE.
Referenced by isAssociativeAndCommutative().
|
override |
Definition at line 1870 of file RISCVInstrInfo.cpp.
References getJumpTableIndexFromBase(), getJumpTableIndexFromLoadAddr(), llvm::MachineRegisterInfo::getUniqueVRegDef(), isJumpTableLoad(), and MI.
|
override |
Definition at line 2907 of file RISCVInstrInfo.cpp.
References getFPPatterns(), llvm::TargetInstrInfo::getMachineCombinerPatterns(), and getSHXADDPatterns().
|
override |
Definition at line 2300 of file RISCVInstrInfo.cpp.
References STI, llvm::TS_Local, and llvm::TS_MinInstrCount.
|
override |
Definition at line 3545 of file RISCVInstrInfo.cpp.
References getMemOperandWithOffsetWidth(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::mayLoadOrStore(), llvm::Offset, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
| bool RISCVInstrInfo::getMemOperandWithOffsetWidth | ( | const MachineInstr & | LdSt, |
| const MachineOperand *& | BaseOp, | ||
| int64_t & | Offset, | ||
| LocationSize & | Width ) const |
Definition at line 3655 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(), and llvm::Offset.
Referenced by areMemAccessesTriviallyDisjoint(), and getMemOperandsWithOffsetWidth().
|
override |
Definition at line 76 of file RISCVInstrInfo.cpp.
References llvm::MCInstBuilder::addImm(), llvm::MCInstBuilder::addReg(), and STI.
|
override |
Definition at line 3896 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 STI.
|
override |
Definition at line 3986 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 2587 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 3718 of file RISCVInstrInfo.cpp.
References llvm::ArrayRef().
|
override |
Definition at line 5217 of file RISCVInstrInfo.cpp.
References llvm::ArrayRef(), llvm::MONontemporalBit0, and llvm::MONontemporalBit1.
|
override |
Definition at line 5224 of file RISCVInstrInfo.cpp.
References llvm::Aggressive, and STI.
|
override |
Definition at line 2564 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 2598 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 1462 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 1500 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addMBB(), assert(), llvm::MachineBasicBlock::back(), llvm::BuildMI(), llvm::MachineRegisterInfo::clearVirtRegs(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::Dead, 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 4037 of file RISCVInstrInfo.cpp.
References assert(), llvm::BuildMI(), C(), llvm::dwarf_linker::DebugLoc, findRegisterToSaveX5To(), llvm::get(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getName(), llvm::RISCVMachineFunctionInfo::hasCFProtectionBranch(), MachineOutlinerRegSave, MachineOutlinerTailCall, MBB, and llvm::RISCVII::MO_CALL.
|
override |
Definition at line 4110 of file RISCVInstrInfo.cpp.
References llvm::MachineOperand::getReg(), llvm::MachineOperand::isReg(), and MI.
|
override |
Definition at line 2221 of file RISCVInstrInfo.cpp.
References MI.
|
override |
Definition at line 2621 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 1755 of file RISCVInstrInfo.cpp.
References llvm::isInt(), llvm_unreachable, llvm::SignExtend64(), and STI.
|
override |
Definition at line 2247 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 1603 of file RISCVInstrInfo.cpp.
References DefMI, llvm::MachineRegisterInfo::getVRegDef(), Imm, and isLoadImm().
Referenced by INITIALIZE_PASS(), and optimizeCondBranch().
|
override |
Definition at line 3740 of file RISCVInstrInfo.cpp.
References F, and llvm::MachineFunction::getFunction().
|
override |
Definition at line 5551 of file RISCVInstrInfo.cpp.
References llvm::RISCV::getRVVMCOpcode(), and Opc.
|
static |
Definition at line 3524 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 85 of file RISCVInstrInfo.cpp.
References llvm::TypeSize::getZero(), isLoadFromStackSlot(), and MI.
Referenced by isLoadFromStackSlot().
|
override |
Definition at line 122 of file RISCVInstrInfo.cpp.
References llvm::TypeSize::getFixed(), getLMULForRVVWholeLoadStore(), llvm::TypeSize::getScalable(), MI, Register, and llvm::RISCV::RVVBytesPerBlock.
|
override |
Definition at line 3757 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 3512 of file RISCVInstrInfo.cpp.
References Opc.
|
override |
Definition at line 221 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 5635 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 170 of file RISCVInstrInfo.cpp.
References llvm::TypeSize::getZero(), isStoreToStackSlot(), and MI.
Referenced by isStoreToStackSlot().
|
override |
Definition at line 176 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 5600 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 740 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 997 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), 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 5112 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 1622 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 2028 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 1428 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 5624 of file RISCVInstrInfo.cpp.
References llvm::MachineMemOperand::isNonTemporal(), and MI.
Referenced by getInstSizeInBytes().
|
override |
Definition at line 1575 of file RISCVInstrInfo.cpp.
References assert(), Cond, llvm::getImm(), and llvm::RISCVCC::getInverseBranchOpcode().
Referenced by analyzeLoopForPipelining().
|
inlineoverride |
Definition at line 107 of file RISCVInstrInfo.h.
References MI.
|
override |
Definition at line 3621 of file RISCVInstrInfo.cpp.
References CacheLineSize, llvm::ArrayRef< T >::empty(), llvm::ArrayRef< T >::front(), and memOpsHaveSameBasePtr().
|
override |
Definition at line 3770 of file RISCVInstrInfo.cpp.
References llvm::MachineFunction::getFunction(), and llvm::Function::hasMinSize().
|
override |
Definition at line 4700 of file RISCVInstrInfo.cpp.
References llvm::MachineOperand::CreateImm(), llvm::get(), getSHXADDShiftAmount(), getSHXADDUWShiftAmount(), MI, and Opc.
|
override |
Definition at line 650 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 296 of file RISCVInstrInfo.h.
|
override |
Definition at line 3092 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_UIMM4_PLUS1, llvm::RISCVOp::OPERAND_UIMM5_GT3, llvm::RISCVOp::OPERAND_UIMM5_NONZERO, llvm::RISCVOp::OPERAND_UIMM5_PLUS1, llvm::RISCVOp::OPERAND_UIMM6_PLUS1, 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 374 of file RISCVInstrInfo.h.
Referenced by analyzeCandidate(), buildClearRegister(), canFoldIntoAddrMode(), copyPhysReg(), copyPhysRegVector(), foldMemoryOperandImpl(), foldMemoryOperandImpl(), getInstSizeInBytes(), getMachineCombinerTraceStrategy(), getNop(), getOutliningCandidateInfo(), getTailDuplicateSize(), insertIndirectBranch(), isBranchOffsetInRange(), loadRegFromStackSlot(), movImm(), mulImm(), optimizeSelect(), RISCVInstrInfo(), storeRegToStackSlot(), and verifyInstruction().