|
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 69 of file RISCVInstrInfo.cpp.
References STI.
|
override |
Definition at line 1373 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 3851 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 5510 of file RISCVInstrInfo.cpp.
References analyzeBranch(), assert(), Cond, llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm::MachineRegisterInfo::getVRegDef(), reverseBranchCondition(), and TBB.
|
override |
Definition at line 3696 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 4087 of file RISCVInstrInfo.cpp.
References llvm::BuildMI(), contains(), DL, llvm::get(), MBB, llvm::reportFatalInternalError(), STI, and TRI.
|
override |
Definition at line 4023 of file RISCVInstrInfo.cpp.
References llvm::BuildMI(), llvm::dwarf_linker::DebugLoc, llvm::get(), MachineOutlinerTailCall, and MBB.
|
override |
Definition at line 3453 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 4536 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 5009 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 491 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 368 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 4129 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 3729 of file RISCVInstrInfo.cpp.
References llvm::RISCVII::MO_DIRECT_FLAG_MASK.
|
override |
Definition at line 3509 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 1118 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 2333 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 4292 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 918 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 964 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 3077 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 1765 of file RISCVInstrInfo.cpp.
Referenced by analyzeBranch().
|
override |
Definition at line 2912 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 1079 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 2110 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 2694 of file RISCVInstrInfo.cpp.
References RVV_OPC_LMUL_CASE, and RVV_OPC_LMUL_MASK_CASE.
Referenced by isAssociativeAndCommutative().
|
override |
Definition at line 1887 of file RISCVInstrInfo.cpp.
References getJumpTableIndexFromBase(), getJumpTableIndexFromLoadAddr(), llvm::MachineRegisterInfo::getUniqueVRegDef(), isJumpTableLoad(), and MI.
|
override |
Definition at line 2924 of file RISCVInstrInfo.cpp.
References getFPPatterns(), llvm::TargetInstrInfo::getMachineCombinerPatterns(), and getSHXADDPatterns().
|
override |
Definition at line 2317 of file RISCVInstrInfo.cpp.
References STI, llvm::TS_Local, and llvm::TS_MinInstrCount.
|
override |
Definition at line 3562 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 3672 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 77 of file RISCVInstrInfo.cpp.
References llvm::MCInstBuilder::addImm(), llvm::MCInstBuilder::addReg(), and STI.
|
override |
Definition at line 3897 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 3987 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 2604 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 3735 of file RISCVInstrInfo.cpp.
References llvm::ArrayRef().
|
override |
Definition at line 5218 of file RISCVInstrInfo.cpp.
References llvm::ArrayRef(), llvm::MONontemporalBit0, and llvm::MONontemporalBit1.
|
override |
Definition at line 5225 of file RISCVInstrInfo.cpp.
References llvm::Aggressive, and STI.
|
override |
Definition at line 2581 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 2615 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 1479 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 1517 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 4038 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 4111 of file RISCVInstrInfo.cpp.
References llvm::MachineOperand::getReg(), llvm::MachineOperand::isReg(), and MI.
|
override |
Definition at line 2238 of file RISCVInstrInfo.cpp.
References MI.
|
override |
Definition at line 2638 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 1772 of file RISCVInstrInfo.cpp.
References llvm::isInt(), llvm_unreachable, llvm::SignExtend64(), and STI.
|
override |
Definition at line 2264 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 1620 of file RISCVInstrInfo.cpp.
References DefMI, llvm::MachineRegisterInfo::getVRegDef(), Imm, and isLoadImm().
Referenced by INITIALIZE_PASS(), and optimizeCondBranch().
|
override |
Definition at line 5552 of file RISCVInstrInfo.cpp.
References llvm::RISCV::getRVVMCOpcode(), and Opc.
|
static |
Definition at line 3541 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 86 of file RISCVInstrInfo.cpp.
References llvm::TypeSize::getZero(), isLoadFromStackSlot(), and MI.
Referenced by isLoadFromStackSlot().
|
override |
Definition at line 123 of file RISCVInstrInfo.cpp.
References llvm::TypeSize::getFixed(), getLMULForRVVWholeLoadStore(), llvm::TypeSize::getScalable(), MI, Register, and llvm::RISCV::RVVBytesPerBlock.
|
override |
Definition at line 3758 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 3529 of file RISCVInstrInfo.cpp.
References Opc.
|
override |
Definition at line 222 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 5636 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 171 of file RISCVInstrInfo.cpp.
References llvm::TypeSize::getZero(), isStoreToStackSlot(), and MI.
Referenced by isStoreToStackSlot().
|
override |
Definition at line 177 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 5601 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 757 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 1014 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 5113 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 1639 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 2045 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 1445 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 5625 of file RISCVInstrInfo.cpp.
References llvm::MachineMemOperand::isNonTemporal(), and MI.
Referenced by getInstSizeInBytes().
|
override |
Definition at line 1592 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 3638 of file RISCVInstrInfo.cpp.
References CacheLineSize, llvm::ArrayRef< T >::empty(), llvm::ArrayRef< T >::front(), and memOpsHaveSameBasePtr().
|
override |
Definition at line 3771 of file RISCVInstrInfo.cpp.
References llvm::MachineFunction::getFunction(), and llvm::Function::hasMinSize().
|
override |
Definition at line 4701 of file RISCVInstrInfo.cpp.
References llvm::MachineOperand::CreateImm(), llvm::get(), getSHXADDShiftAmount(), getSHXADDUWShiftAmount(), MI, and Opc.
|
override |
Definition at line 667 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 238 of file RISCVInstrInfo.h.
|
inlineoverride |
Definition at line 294 of file RISCVInstrInfo.h.
|
override |
Definition at line 3109 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 372 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().