LLVM 18.0.0git
|
#include "Target/RISCV/RISCVInstrInfo.h"
Protected Attributes | |
const RISCVSubtarget & | STI |
Definition at line 49 of file RISCVInstrInfo.h.
|
explicit |
Definition at line 67 of file RISCVInstrInfo.cpp.
|
override |
Definition at line 854 of file RISCVInstrInfo.cpp.
References Cond, llvm::MachineBasicBlock::end(), getBranchDestBlock(), llvm::MachineBasicBlock::getLastNonDebugInstr(), llvm::MachineInstrBundleIterator< Ty, IsReverse >::getReverse(), I, MBB, parseCondBranch(), llvm::MachineBasicBlock::rend(), and TBB.
|
override |
|
override |
Definition at line 1935 of file RISCVInstrInfo.cpp.
References assert(), getMemOperandWithOffsetWidth(), llvm::RISCVSubtarget::getRegisterInfo(), llvm::MachineInstr::hasOrderedMemoryRef(), llvm::MachineInstr::hasUnmodeledSideEffects(), llvm::MachineOperand::isIdenticalTo(), llvm::MachineInstr::mayLoadOrStore(), STI, and TRI.
|
override |
Definition at line 2106 of file RISCVInstrInfo.cpp.
References llvm::MachineBasicBlock::addLiveIn(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::RegState::Define, E, llvm::MachineBasicBlock::end(), llvm::get(), I, llvm::MachineBasicBlock::insert(), and MBB.
|
override |
Definition at line 2383 of file RISCVInstrInfo.cpp.
References assert(), CASE_VFMA_CHANGE_OPCODE_LMULS, CASE_VFMA_CHANGE_OPCODE_LMULS_MF4, CASE_VFMA_CHANGE_OPCODE_SPLATS, CASE_VFMA_OPCODE_LMULS, CASE_VFMA_OPCODE_LMULS_MF4, CASE_VFMA_SPLATS, CC, llvm::TargetInstrInfo::commuteInstructionImpl(), llvm::FMSUB, llvm::FNMADD, llvm::FNMSUB, llvm::get(), llvm::RISCVCC::getOppositeBranchCondition(), llvm_unreachable, and MI.
|
override |
Definition at line 2536 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), CASE_WIDEOP_CHANGE_OPCODE_LMULS, CASE_WIDEOP_CHANGE_OPCODE_LMULS_MF4, CASE_WIDEOP_OPCODE_LMULS, CASE_WIDEOP_OPCODE_LMULS_MF4, llvm::MachineInstrBuilder::copyImplicitOps(), llvm::LiveRange::Segment::end, llvm::get(), llvm::LiveIntervals::getInterval(), llvm::LiveRange::getSegmentContaining(), llvm::RISCVII::getVecPolicyOpNum(), llvm::RISCVII::hasVecPolicyOp(), I, Idx, llvm_unreachable, MBB, MI, llvm::LiveVariables::replaceKillInstruction(), llvm::LiveIntervals::ReplaceMachineInstrInMaps(), and llvm::RegState::Undef.
|
override |
Definition at line 296 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), contains(), llvm::RISCVVType::decodeVLMUL(), DL, End, forwardCopyWillClobberTuple(), llvm::get(), llvm::getKillRegState(), llvm::RISCVSubtarget::getRegisterInfo(), llvm::RISCVII::getSEWOpNum(), llvm::RISCVII::getVLOpNum(), I, llvm::RegState::Implicit, isConvertibleToVMV_V_V(), llvm_unreachable, llvm::RISCVII::LMUL_1, llvm::RISCVII::LMUL_2, llvm::RISCVII::LMUL_4, llvm::RISCVII::LMUL_8, MBB, MBBI, STI, TRI, and llvm::RegState::Undef.
|
override |
Definition at line 2147 of file RISCVInstrInfo.cpp.
References assert(), llvm::TargetInstrInfo::createMIROperandComment(), llvm::raw_ostream::flush(), llvm::RISCVII::getSEWOpNum(), llvm::RISCVII::getVecPolicyOpNum(), llvm::RISCVII::hasSEWOp(), llvm::RISCVII::hasVecPolicyOp(), llvm::RISCVVType::isValidSEW(), Log2SEW, llvm::RISCVII::MASK_AGNOSTIC, MI, OS, llvm::RISCVVType::printVType(), SEW, llvm::RISCVII::TAIL_AGNOSTIC, TRI, and TSFlags.
|
override |
Definition at line 1967 of file RISCVInstrInfo.cpp.
References llvm::RISCVII::MO_DIRECT_FLAG_MASK.
|
override |
Definition at line 1395 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::RISCV::getNamedOperandIdx(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::RegState::Implicit, and MI.
|
override |
Definition at line 2221 of file RISCVInstrInfo.cpp.
References assert(), CASE_VFMA_OPCODE_LMULS, CASE_VFMA_OPCODE_LMULS_MF4, CASE_VFMA_SPLATS, llvm::TargetInstrInfo::findCommutedOpIndices(), llvm::FMSUB, llvm::FNMADD, llvm::FNMSUB, llvm::RISCVII::hasVecPolicyOp(), and MI.
|
inline |
Target-dependent implementation for foldMemoryOperand.
Target-independent code in foldMemoryOperand will take care of adding a MachineMemOperand to the newly created instruction. The instruction and any auxiliary instructions necessary will be inserted at InsertPt.
Definition at line 1283 of file TargetInstrInfo.h.
|
override |
Definition at line 679 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMemOperand(), llvm::BuildMI(), llvm::get(), llvm::MachineFunction::getDataLayout(), llvm::MachinePointerInfo::getFixedStack(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineFrameInfo::getObjectAlign(), llvm::MachineFrameInfo::getObjectSize(), llvm::DataLayout::isBigEndian(), llvm::RISCV::isSEXT_W(), llvm::RISCV::isZEXT_B(), llvm::RISCV::isZEXT_W(), MI, llvm::MachineMemOperand::MOLoad, and llvm::ArrayRef< T >::size().
|
inline |
Target-dependent implementation for foldMemoryOperand.
Target-independent code in foldMemoryOperand will take care of adding a MachineMemOperand to the newly created instruction. The instruction and any auxiliary instructions necessary will be inserted at InsertPt.
Definition at line 1296 of file TargetInstrInfo.h.
|
override |
Definition at line 1703 of file RISCVInstrInfo.cpp.
References combineFPFusedMultiply(), llvm::FMADD_AX, llvm::FMADD_XA, llvm::FMSUB, llvm::FNMSUB, llvm::TargetInstrInfo::genAlternativeCodeSequence(), llvm::MachineInstr::getMF(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), and MRI.
|
override |
Definition at line 1071 of file RISCVInstrInfo.cpp.
Referenced by analyzeBranch().
const MCInstrDesc & RISCVInstrInfo::getBrCond | ( | RISCVCC::CondCode | CC | ) | const |
Definition at line 816 of file RISCVInstrInfo.cpp.
References CC, llvm::RISCVCC::COND_EQ, llvm::RISCVCC::COND_GE, llvm::RISCVCC::COND_GEU, llvm::RISCVCC::COND_LT, llvm::RISCVCC::COND_LTU, llvm::RISCVCC::COND_NE, llvm::get(), and llvm_unreachable.
Referenced by insertBranch().
|
override |
Definition at line 1269 of file RISCVInstrInfo.cpp.
References llvm::get(), llvm::MachineFunction::getSubtarget(), llvm::MachineFunction::getTarget(), llvm::MachineMemOperand::isNonTemporal(), MI, STI, and TM.
Referenced by getOutliningCandidateInfo(), insertBranch(), and removeBranch().
Definition at line 1530 of file RISCVInstrInfo.cpp.
Referenced by isAssociativeAndCommutative().
|
override |
Definition at line 1614 of file RISCVInstrInfo.cpp.
References getFPPatterns(), and llvm::TargetInstrInfo::getMachineCombinerPatterns().
|
override |
Definition at line 1372 of file RISCVInstrInfo.cpp.
References ForceMachineCombinerStrategy, STI, llvm::TS_Local, and llvm::TS_MinInstrCount.
bool RISCVInstrInfo::getMemOperandWithOffsetWidth | ( | const MachineInstr & | LdSt, |
const MachineOperand *& | BaseOp, | ||
int64_t & | Offset, | ||
unsigned & | Width, | ||
const TargetRegisterInfo * | TRI | ||
) | const |
Definition at line 1912 of file RISCVInstrInfo.cpp.
References llvm::MachineOperand::getImm(), llvm::MachineInstr::getNumExplicitOperands(), llvm::MachineInstr::getOperand(), getSize(), llvm::MachineInstr::hasOneMemOperand(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isReg(), llvm::MachineInstr::mayLoadOrStore(), llvm::MachineInstr::memoperands_begin(), and llvm::Offset.
Referenced by areMemAccessesTriviallyDisjoint().
|
override |
Definition at line 71 of file RISCVInstrInfo.cpp.
References llvm::MCInstBuilder::addImm(), llvm::MCInstBuilder::addReg(), llvm::RISCVSubtarget::hasStdExtCOrZca(), and STI.
|
override |
Definition at line 2024 of file RISCVInstrInfo.cpp.
References llvm::CallingConv::C, E, llvm::erase_if(), getInstSizeInBytes(), I, MachineOutlinerDefault, and TRI.
|
overridevirtual |
Definition at line 2065 of file RISCVInstrInfo.cpp.
References F, llvm::MachineBasicBlock::getParent(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::outliner::Illegal, llvm::outliner::Invisible, llvm::outliner::Legal, MBB, MBBI, MI, llvm::RISCVII::MO_PCREL_LO, and TRI.
|
override |
Definition at line 1973 of file RISCVInstrInfo.cpp.
|
override |
Definition at line 2730 of file RISCVInstrInfo.cpp.
References llvm::MONontemporalBit0, and llvm::MONontemporalBit1.
void RISCVInstrInfo::getVLENFactoredAmount | ( | MachineFunction & | MF, |
MachineBasicBlock & | MBB, | ||
MachineBasicBlock::iterator | II, | ||
const DebugLoc & | DL, | ||
Register | DestReg, | ||
int64_t | Amount, | ||
MachineInstr::MIFlag | Flag = MachineInstr::NoFlags |
||
) | const |
Definition at line 2640 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::LLVMContext::diagnose(), DL, llvm::get(), llvm::Function::getContext(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getRegInfo(), llvm::isPowerOf2_64(), llvm::RegState::Kill, llvm_unreachable, llvm::Log2_32(), llvm::Log2_64(), MBB, movImm(), MRI, N, llvm::MachineInstrBuilder::setMIFlag(), and STI.
|
override |
Definition at line 1458 of file RISCVInstrInfo.cpp.
References llvm::MachineInstr::getMF(), llvm::RISCV::getNamedOperandIdx(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::RISCV::hasEqualFRM(), llvm::TargetInstrInfo::hasReassociableSibling(), and MRI.
|
override |
Definition at line 960 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addMBB(), assert(), llvm::BuildMI(), CC, Cond, DL, llvm::get(), getBrCond(), getInstSizeInBytes(), MBB, MI, and TBB.
|
override |
Definition at line 997 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::MachineBasicBlock::back(), llvm::BuildMI(), llvm::RegState::Dead, llvm::RegState::Define, DL, llvm::MachineBasicBlock::empty(), llvm::MachineBasicBlock::end(), llvm::RegScavenger::enterBasicBlockEnd(), llvm::get(), llvm::RISCVMachineFunctionInfo::getBranchRelaxationScratchFrameIndex(), llvm::MachineFunction::getInfo(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), loadRegFromStackSlot(), MBB, MI, llvm::RISCVII::MO_CALL, MRI, llvm::MachineBasicBlock::pred_size(), llvm::report_fatal_error(), llvm::RegScavenger::scavengeRegisterBackwards(), llvm::RegScavenger::setRegUsed(), storeRegToStackSlot(), and TRI.
|
override |
Definition at line 2134 of file RISCVInstrInfo.cpp.
References llvm::BuildMI(), llvm::get(), llvm::MachineFunction::getName(), llvm::MachineBasicBlock::insert(), MBB, and llvm::RISCVII::MO_CALL.
|
override |
Definition at line 1318 of file RISCVInstrInfo.cpp.
References MI.
|
override |
Definition at line 1477 of file RISCVInstrInfo.cpp.
References llvm::MachineInstr::FmNsz, llvm::MachineInstr::FmReassoc, llvm::MachineInstr::getFlag(), getInverseOpcode(), llvm::MachineInstr::getOpcode(), isFADD(), and isFMUL().
Definition at line 1078 of file RISCVInstrInfo.cpp.
References llvm::RISCVSubtarget::getXLen(), llvm::isIntN(), llvm_unreachable, llvm::SignExtend64(), and STI.
|
override |
Definition at line 1344 of file RISCVInstrInfo.cpp.
References MI.
|
override |
Definition at line 1990 of file RISCVInstrInfo.cpp.
References F, and llvm::MachineFunction::getFunction().
|
override |
Definition at line 80 of file RISCVInstrInfo.cpp.
References isLoadFromStackSlot(), and MI.
Referenced by isLoadFromStackSlot().
|
override |
Definition at line 86 of file RISCVInstrInfo.cpp.
References MI.
|
override |
Definition at line 2007 of file RISCVInstrInfo.cpp.
References llvm::TargetInstrInfo::isMBBSafeToOutlineFrom(), and MBB.
|
override |
Definition at line 121 of file RISCVInstrInfo.cpp.
References isStoreToStackSlot(), and MI.
Referenced by isStoreToStackSlot().
|
override |
Definition at line 127 of file RISCVInstrInfo.cpp.
References MI.
|
override |
Definition at line 598 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMemOperand(), llvm::BuildMI(), llvm::get(), llvm::MachinePointerInfo::getFixedStack(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineFrameInfo::getObjectAlign(), llvm::MachineFrameInfo::getObjectSize(), llvm::MachineBasicBlock::getParent(), I, llvm_unreachable, MBB, llvm::MachineMemOperand::MOLoad, llvm::TargetStackID::ScalableVector, llvm::MachineFrameInfo::setStackID(), TRI, and llvm::MemoryLocation::UnknownSize.
Referenced by insertIndirectBranch().
void RISCVInstrInfo::movImm | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock::iterator | MBBI, | ||
const DebugLoc & | DL, | ||
Register | DstReg, | ||
uint64_t | Val, | ||
MachineInstr::MIFlag | Flag = MachineInstr::NoFlags |
||
) | const |
Definition at line 737 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), DL, llvm::SmallVectorBase< Size_T >::empty(), llvm::RISCVMatInt::generateInstSeq(), llvm::get(), llvm::RISCVMatInt::Imm, llvm::RISCVSubtarget::is64Bit(), llvm::RegState::Kill, MBB, MBBI, llvm::RISCVMatInt::RegImm, llvm::RISCVMatInt::RegReg, llvm::RISCVMatInt::RegX0, llvm::report_fatal_error(), llvm::MachineInstrBuilder::setMIFlag(), and STI.
Referenced by getVLENFactoredAmount().
|
override |
Definition at line 1204 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), assert(), llvm::BuildMI(), canFoldAsPredicatedOp(), CC, llvm::MachineInstr::clearKillInfo(), DefMI, llvm::SmallPtrSetImpl< PtrType >::erase(), llvm::MachineInstr::eraseFromParent(), llvm::get(), llvm::MachineInstr::getDesc(), llvm::MCInstrDesc::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::RISCVCC::getOppositeBranchCondition(), llvm::MachineInstr::getParent(), getPredicatedOpcode(), llvm::MachineOperand::getReg(), llvm::SmallPtrSetImpl< PtrType >::insert(), MI, MRI, and STI.
|
override |
Definition at line 926 of file RISCVInstrInfo.cpp.
References llvm::MachineBasicBlock::begin(), llvm::MachineBasicBlock::end(), getInstSizeInBytes(), llvm::MachineBasicBlock::getLastNonDebugInstr(), I, and MBB.
|
override |
Definition at line 1062 of file RISCVInstrInfo.cpp.
References assert(), CC, Cond, and getOppositeBranchCondition().
|
override |
Definition at line 1386 of file RISCVInstrInfo.cpp.
References llvm::MachineInstr::getFlags(), and llvm::MachineInstr::setFlags().
|
override |
Definition at line 2018 of file RISCVInstrInfo.cpp.
References llvm::MachineFunction::getFunction(), and llvm::Function::hasMinSize().
|
override |
Definition at line 515 of file RISCVInstrInfo.cpp.
References llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMemOperand(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::get(), llvm::MachinePointerInfo::getFixedStack(), llvm::MachineFunction::getFrameInfo(), llvm::getKillRegState(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineFrameInfo::getObjectAlign(), llvm::MachineFrameInfo::getObjectSize(), llvm::MachineBasicBlock::getParent(), I, llvm_unreachable, MBB, llvm::MachineMemOperand::MOStore, llvm::TargetStackID::ScalableVector, llvm::MachineFrameInfo::setStackID(), TRI, and llvm::MemoryLocation::UnknownSize.
Referenced by insertIndirectBranch().
|
inlineoverride |
Definition at line 205 of file RISCVInstrInfo.h.
|
override |
Definition at line 1729 of file RISCVInstrInfo.cpp.
References CASE_OPERAND_UIMM, llvm::enumerate(), llvm::MachineOperand::getImm(), llvm::RISCVII::getSEWOpNum(), llvm::RISCVII::getVecPolicyOpNum(), llvm::RISCVII::getVLOpNum(), llvm::RISCVII::hasSEWOp(), llvm::RISCVII::hasVecPolicyOp(), llvm::RISCVII::hasVLOp(), llvm::RISCVSubtarget::is64Bit(), llvm::MachineOperand::isImm(), llvm::RISCVVType::isValidSEW(), llvm_unreachable, Log2SEW, llvm::RISCVII::MASK_AGNOSTIC, MI, MRI, llvm::RISCVOp::OPERAND_CLUI_IMM, llvm::RISCVOp::OPERAND_FIRST_RISCV_IMM, llvm::RISCVOp::OPERAND_LAST_RISCV_IMM, 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_SIMM10_LSB0000_NONZERO, llvm::RISCVOp::OPERAND_SIMM12, llvm::RISCVOp::OPERAND_SIMM12_LSB00000, llvm::RISCVOp::OPERAND_SIMM5, llvm::RISCVOp::OPERAND_SIMM5_PLUS1, llvm::RISCVOp::OPERAND_SIMM6, llvm::RISCVOp::OPERAND_SIMM6_NONZERO, llvm::RISCVOp::OPERAND_UIMM10_LSB00_NONZERO, llvm::RISCVOp::OPERAND_UIMM2_LSB0, llvm::RISCVOp::OPERAND_UIMM7_LSB00, llvm::RISCVOp::OPERAND_UIMM8_GE32, llvm::RISCVOp::OPERAND_UIMM8_LSB00, llvm::RISCVOp::OPERAND_UIMM8_LSB000, llvm::RISCVOp::OPERAND_UIMM9_LSB000, llvm::RISCVOp::OPERAND_UIMMLOG2XLEN, llvm::RISCVOp::OPERAND_UIMMLOG2XLEN_NONZERO, llvm::RISCVOp::OPERAND_VTYPEI10, llvm::RISCVOp::OPERAND_VTYPEI11, llvm::RISCVOp::OPERAND_ZERO, SEW, STI, llvm::RISCVII::TAIL_AGNOSTIC, and TSFlags.
|
protected |
Definition at line 239 of file RISCVInstrInfo.h.
Referenced by analyzeSelect(), areMemAccessesTriviallyDisjoint(), copyPhysReg(), getInstSizeInBytes(), getMachineCombinerTraceStrategy(), getNop(), getVLENFactoredAmount(), isBranchOffsetInRange(), movImm(), optimizeSelect(), and verifyInstruction().