|
LLVM 22.0.0git
|
#include "Target/PowerPC/PPCInstrInfo.h"
Static Public Member Functions | |
| static bool | isSameClassPhysRegCopy (unsigned Opcode) |
| static bool | hasPCRelFlag (unsigned TF) |
| static bool | hasGOTFlag (unsigned TF) |
| static bool | hasTLSFlag (unsigned TF) |
| static int | getRecordFormOpcode (unsigned Opcode) |
Protected Member Functions | |
| MachineInstr * | commuteInstructionImpl (MachineInstr &MI, bool NewMI, unsigned OpIdx1, unsigned OpIdx2) const override |
| Commutes the operands in the given instruction. | |
Definition at line 281 of file PPCInstrInfo.h.
|
explicit |
Definition at line 91 of file PPCInstrInfo.cpp.
Referenced by promoteInstr32To64ForElimEXTSW().
|
override |
Definition at line 1259 of file PPCInstrInfo.cpp.
References Cond, llvm::MachineOperand::CreateImm(), llvm::MachineOperand::CreateReg(), DisableCTRLoopAnal, llvm::MachineOperand::getMBB(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), I, llvm::MachineOperand::isMBB(), MBB, llvm::PPC::PRED_BIT_SET, llvm::PPC::PRED_BIT_UNSET, and TBB.
|
override |
Definition at line 2402 of file PPCInstrInfo.cpp.
Referenced by optimizeCmpPostRA().
|
override |
Analyze loop L, which must be a single-basic-block loop, and if the conditions can be understood enough produce a PipelinerLoopInfo object.
Definition at line 5767 of file PPCInstrInfo.cpp.
References llvm::MachineBasicBlock::end(), findLoopInstr(), llvm::MachineBasicBlock::getFirstTerminator(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), I, isBDNZ(), MRI, and llvm::MachineBasicBlock::pred_begin().
|
override |
Return true if two MIs access different memory addresses and false otherwise.
Definition at line 5825 of file PPCInstrInfo.cpp.
References assert(), getMemOperandWithOffsetWidth(), getRegisterInfo(), llvm::LocationSize::getValue(), llvm::MachineInstr::hasOrderedMemoryRef(), llvm::MachineInstr::hasUnmodeledSideEffects(), llvm::LocationSize::hasValue(), llvm::MachineOperand::isIdenticalTo(), llvm::MachineInstr::mayLoadOrStore(), llvm::LocationSize::precise(), and TRI.
|
override |
Definition at line 1519 of file PPCInstrInfo.cpp.
References Cond, getReg(), isPhysical(), MBB, and MRI.
|
override |
Definition at line 2367 of file PPCInstrInfo.cpp.
References llvm::TargetRegisterClass::contains(), and MI.
| bool PPCInstrInfo::combineRLWINM | ( | MachineInstr & | MI, |
| MachineInstr ** | ToErase = nullptr ) const |
Definition at line 3860 of file PPCInstrInfo.cpp.
References assert(), llvm::dbgs(), llvm::MachineInstr::dump(), llvm::get(), llvm::APInt::getBitsSetWithWrap(), llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::APInt::getZExtValue(), llvm::MachineInstr::hasImplicitDef(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isKill(), llvm::isRunOfOnes(), llvm::Register::isVirtual(), llvm::APInt::isZero(), LLVM_DEBUG, MI, MRI, llvm::APInt::rotl(), and llvm::MachineOperand::setIsKill().
|
overrideprotected |
Commutes the operands in the given instruction.
The commutable operands are specified by their indices OpIdx1 and OpIdx2.
Do not call this method for a non-commutable instruction or for non-commutable pair of operand indices OpIdx1 and OpIdx2. Even though the instruction is commutable, the method may still fail to commute the operands, null pointer is returned in such cases.
For example, we can commute rlwimi instructions, but only if the rotate amt is zero. We also have to munge the immediates a bit.
Definition at line 1130 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::TargetInstrInfo::commuteInstructionImpl(), llvm::RegState::Define, llvm::getDeadRegState(), llvm::getKillRegState(), MI, and llvm::MCOI::TIED_TO.
| bool PPCInstrInfo::convertToImmediateForm | ( | MachineInstr & | MI, |
| SmallSet< Register, 4 > & | RegsToUpdate, | ||
| MachineInstr ** | KilledDef = nullptr ) const |
Definition at line 3798 of file PPCInstrInfo.cpp.
References assert(), DefMI, llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::SmallSet< T, N, C >::insert(), instrHasImmForm(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isReg(), llvm::PPC::isVFRegister(), MI, and MRI.
|
override |
Definition at line 1677 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), contains(), llvm::RegState::Define, DL, llvm::PPCRegisterInfo::emitAccCopyInfo(), llvm::get(), getCRBitValue(), llvm::getCRFromCRBit(), llvm::getKillRegState(), getRegisterInfo(), I, llvm::RegState::Implicit, llvm::RegState::ImplicitDefine, llvm::RegState::Kill, llvm_unreachable, MBB, Opc, TRI, and VSXSelfCopyCrash.
|
override |
CreateTargetHazardRecognizer - Return the hazard recognizer to use for this target when scheduling the DAG.
Definition at line 100 of file PPCInstrInfo.cpp.
References llvm::TargetInstrInfo::CreateTargetHazardRecognizer(), llvm::PPC::DIR_440, llvm::PPC::DIR_A2, llvm::PPC::DIR_E500mc, llvm::PPC::DIR_E5500, and II.
|
override |
CreateTargetPostRAHazardRecognizer - Return the postRA hazard recognizer to use for this target when scheduling the DAG.
Definition at line 117 of file PPCInstrInfo.cpp.
References assert(), llvm::PPC::DIR_440, llvm::PPC::DIR_A2, llvm::PPC::DIR_E500mc, llvm::PPC::DIR_E5500, llvm::PPC::DIR_PWR7, llvm::PPC::DIR_PWR8, llvm::MachineFunction::getSubtarget(), II, llvm::ScheduleDAG::MF, and llvm::ScheduleDAG::TII.
|
override |
Definition at line 3023 of file PPCInstrInfo.cpp.
|
override |
Definition at line 3134 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), contains(), DL, expandPostRAPseudo(), expandVSXMemPseudo(), llvm::get(), isAnImmediateOperand(), MBB, MI, llvm::Offset, and llvm::PPC::PRED_NE_MINUS.
Referenced by expandPostRAPseudo().
| bool PPCInstrInfo::expandVSXMemPseudo | ( | MachineInstr & | MI | ) | const |
Definition at line 3068 of file PPCInstrInfo.cpp.
References llvm::get(), llvm_unreachable, and MI.
Referenced by expandPostRAPseudo().
|
override |
Fixup the placeholders we put in genAlternativeCodeSequence() for MachineCombiner.
Definition at line 525 of file PPCInstrInfo.cpp.
References assert(), llvm::CallingConv::C, llvm::APFloat::changeSign(), llvm::dyn_cast(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), FMAOpIdxInfo, getConstantFromConstantPool(), llvm::MachineFunction::getConstantPool(), llvm::MachineConstantPool::getConstantPoolIndex(), llvm::MachineFunction::getDataLayout(), llvm::MachineInstr::getMF(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::DataLayout::getPrefTypeAlign(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), getRegisterInfo(), InfoArrayIdxMULOpIdx, llvm::isa(), MRI, llvm::REASSOC_XY_BAC, llvm::REASSOC_XY_BCA, and TRI.
|
override |
Definition at line 1214 of file PPCInstrInfo.cpp.
References llvm::TargetInstrInfo::findCommutedOpIndices(), llvm::PPC::getAltVSXFMAOpcode(), and MI.
| MachineInstr * PPCInstrInfo::findLoopInstr | ( | MachineBasicBlock & | PreHeader, |
| SmallPtrSet< MachineBasicBlock *, 8 > & | Visited ) const |
Find the hardware loop instruction used to set-up the specified loop.
On PPC, we have two instructions used to set-up the hardware loop (MTCTRloop, MTCTR8loop) with corresponding endloop (BDNZ, BDNZ8) instructions to indicate the end of a loop.
Definition at line 5787 of file PPCInstrInfo.cpp.
References I, and llvm::MachineBasicBlock::instrs().
Referenced by analyzeLoopForPipelining().
| bool PPCInstrInfo::foldFrameOffset | ( | MachineInstr & | MI | ) | const |
Definition at line 3589 of file PPCInstrInfo.cpp.
References assert(), llvm::dbgs(), llvm::MachineInstr::dump(), llvm::MachineInstr::eraseFromParent(), llvm::get(), getDefMIPostRA(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), getRegisterInfo(), llvm::ImmInstrInfo::ImmOpNo, isADDInstrEligibleForFolding(), isImmInstrEligibleForFolding(), llvm::MachineOperand::isKill(), isValidToBeChangedReg(), LLVM_DEBUG, MI, MRI, llvm::ImmInstrInfo::OpNoForForwarding, llvm::MachineOperand::setImm(), and llvm::ImmInstrInfo::ZeroIsSpecialOrig.
|
override |
Definition at line 2173 of file PPCInstrInfo.cpp.
References Changed, DefMI, MRI, onlyFoldImmediate(), and UseMI.
|
override |
When getMachineCombinerPatterns() finds patterns, this function generates the instructions that could replace the original code sequence.
Definition at line 767 of file PPCInstrInfo.cpp.
References llvm::TargetInstrInfo::genAlternativeCodeSequence(), llvm::REASSOC_XMM_AMM_BMM, llvm::REASSOC_XY_AMM_BMM, llvm::REASSOC_XY_BAC, and llvm::REASSOC_XY_BCA.
|
override |
Definition at line 739 of file PPCInstrInfo.cpp.
References llvm::TargetInstrInfo::getCombinerObjective(), llvm::MustReduceDepth, llvm::MustReduceRegisterPressure, llvm::REASSOC_XMM_AMM_BMM, llvm::REASSOC_XY_AMM_BMM, llvm::REASSOC_XY_BAC, and llvm::REASSOC_XY_BCA.
| const Constant * PPCInstrInfo::getConstantFromConstantPool | ( | MachineInstr * | I | ) | const |
Definition at line 719 of file PPCInstrInfo.cpp.
References assert(), DefMI, llvm::MachineFunction::getConstantPool(), llvm::MachineConstantPool::getConstants(), llvm::MachineFunction::getRegInfo(), I, and MRI.
Referenced by finalizeInsInstrs().
| MachineInstr * PPCInstrInfo::getDefMIPostRA | ( | unsigned | Reg, |
| MachineInstr & | MI, | ||
| bool & | SeenIntermediateUse ) const |
Definition at line 3400 of file PPCInstrInfo.cpp.
References assert(), getRegisterInfo(), MI, and TRI.
Referenced by foldFrameOffset(), isValidToBeChangedReg(), and optimizeCmpPostRA().
|
inlineoverride |
On PowerPC, we try to reassociate FMA chain which will increase instruction size.
Set extension resource length limit to 1 for edge case. Resource Length is calculated by scaled resource usage in getCycles(). Because of the division in getCycles(), it returns different cycles due to legacy scaled resource usage. So new resource length may be same with legacy or 1 bigger than legacy. We need to execlude the 1 bigger case even the resource length is not perserved for more FMA chain reassociations on PowerPC.
Definition at line 521 of file PPCInstrInfo.h.
| bool PPCInstrInfo::getFMAPatterns | ( | MachineInstr & | Root, |
| SmallVectorImpl< unsigned > & | Patterns, | ||
| bool | DoRegPressureReduce ) const |
Return true when there is potentially a faster code sequence for a fma chain ending in Root.
All potential patterns are output in the P array.
Definition at line 350 of file PPCInstrInfo.cpp.
References assert(), llvm::dbgs(), FMAOpIdxInfo, llvm::MachineInstr::FmNsz, llvm::MachineInstr::FmReassoc, llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), getRegisterInfo(), InfoArrayIdxAddOpIdx, InfoArrayIdxFAddInst, InfoArrayIdxFSubInst, InfoArrayIdxMULOpIdx, isLoadFromConstantPool(), llvm::Register::isVirtual(), LLVM_DEBUG, MBB, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::REASSOC_XMM_AMM_BMM, llvm::REASSOC_XY_AMM_BMM, llvm::REASSOC_XY_BAC, llvm::REASSOC_XY_BCA, and TRI.
Referenced by getMachineCombinerPatterns().
|
override |
Definition at line 137 of file PPCInstrInfo.cpp.
References llvm::InstrItineraryData::getOperandCycle(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isImplicit(), llvm::MachineOperand::isReg(), llvm::Latency, MI, and UseOldLatencyCalc.
Referenced by getOperandLatency().
|
override |
GetInstSize - Return the number of bytes of code the specified instruction may be.
This returns the maximum number of bytes.
Definition at line 3004 of file PPCInstrInfo.cpp.
References llvm::get(), llvm::TargetMachine::getMCAsmInfo(), llvm::PatchPointOpers::getNumPatchBytes(), llvm::StackMapOpers::getNumPatchBytes(), llvm::MachineFunction::getTarget(), and MI.
| unsigned PPCInstrInfo::getLoadOpcodeForSpill | ( | const TargetRegisterClass * | RC | ) | const |
Definition at line 1988 of file PPCInstrInfo.cpp.
|
override |
Return true when there is potentially a faster code sequence for an instruction chain ending in <Root>.
All potential patterns are output in the <Pattern> array.
Definition at line 752 of file PPCInstrInfo.cpp.
References llvm::Aggressive, getFMAPatterns(), and llvm::TargetInstrInfo::getMachineCombinerPatterns().
|
override |
Get the base operand and byte offset of an instruction that reads/writes memory.
Definition at line 2892 of file PPCInstrInfo.cpp.
References getMemOperandWithOffsetWidth(), llvm::Offset, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and TRI.
| bool PPCInstrInfo::getMemOperandWithOffsetWidth | ( | const MachineInstr & | LdSt, |
| const MachineOperand *& | BaseOp, | ||
| int64_t & | Offset, | ||
| LocationSize & | Width, | ||
| const TargetRegisterInfo * | TRI ) const |
Return true if get the base operand, byte offset of an instruction and the memory width.
Width is the size of memory that is being loaded/stored (e.g. 1, 2, 4, 8).
Definition at line 5802 of file PPCInstrInfo.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(), getMemOperandsWithOffsetWidth(), and shouldClusterMemOps().
|
override |
Return the noop instruction to use for a noop.
Definition at line 1250 of file PPCInstrInfo.cpp.
References llvm::MCInst::setOpcode().
|
override |
Definition at line 167 of file PPCInstrInfo.cpp.
References DefMI, llvm::PPC::DIR_7400, llvm::PPC::DIR_750, llvm::PPC::DIR_970, llvm::PPC::DIR_E5500, llvm::PPC::DIR_PWR4, llvm::PPC::DIR_PWR5, llvm::PPC::DIR_PWR5X, llvm::PPC::DIR_PWR6, llvm::PPC::DIR_PWR6X, llvm::PPC::DIR_PWR7, llvm::PPC::DIR_PWR8, getInstrLatency(), llvm::MachineOperand::getReg(), llvm::Latency, MRI, and UseMI.
|
inlineoverride |
Definition at line 452 of file PPCInstrInfo.h.
|
static |
Definition at line 5178 of file PPCInstrInfo.cpp.
|
inline |
getRegisterInfo - TargetInstrInfo is a superset of MRegister info.
As such, whenever a client has an instance of instruction info, it should always be able to get register info as well (through this method).
Definition at line 381 of file PPCInstrInfo.h.
Referenced by areMemAccessesTriviallyDisjoint(), copyPhysReg(), finalizeInsInstrs(), foldFrameOffset(), getDefMIPostRA(), getFMAPatterns(), llvm::PPCSubtarget::getRegisterInfo(), optimizeCompareInstr(), replaceInstrOperandWithImm(), shouldClusterMemOps(), and shouldReduceRegisterPressure().
|
override |
Definition at line 3029 of file PPCInstrInfo.cpp.
References llvm::ArrayRef().
| unsigned PPCInstrInfo::getStoreOpcodeForSpill | ( | const TargetRegisterClass * | RC | ) | const |
Definition at line 1982 of file PPCInstrInfo.cpp.
Definition at line 418 of file PPCInstrInfo.h.
References llvm::PPCII::MO_GOT_FLAG, llvm::PPCII::MO_GOT_PCREL_FLAG, llvm::PPCII::MO_GOT_TLSGD_PCREL_FLAG, llvm::PPCII::MO_GOT_TLSLD_PCREL_FLAG, and llvm::PPCII::MO_GOT_TPREL_PCREL_FLAG.
|
inlineoverride |
Definition at line 460 of file PPCInstrInfo.h.
References DefMI.
Definition at line 410 of file PPCInstrInfo.h.
References llvm::PPCII::MO_GOT_PCREL_FLAG, llvm::PPCII::MO_GOT_TLSGD_PCREL_FLAG, llvm::PPCII::MO_GOT_TLSLD_PCREL_FLAG, llvm::PPCII::MO_GOT_TPREL_PCREL_FLAG, llvm::PPCII::MO_PCREL_FLAG, llvm::PPCII::MO_TLS_PCREL_FLAG, and llvm::PPCII::MO_TPREL_PCREL_FLAG.
Referenced by isValidPCRelNode().
Definition at line 425 of file PPCInstrInfo.h.
References llvm::PPCII::MO_DTPREL_LO, llvm::PPCII::MO_GOT_TLSGD_PCREL_FLAG, llvm::PPCII::MO_GOT_TLSLD_PCREL_FLAG, llvm::PPCII::MO_GOT_TPREL_PCREL_FLAG, llvm::PPCII::MO_TLS, llvm::PPCII::MO_TLS_PCREL_FLAG, llvm::PPCII::MO_TLSGD_FLAG, llvm::PPCII::MO_TLSGDM_FLAG, llvm::PPCII::MO_TLSLD_FLAG, llvm::PPCII::MO_TLSLD_LO, llvm::PPCII::MO_TPREL_FLAG, llvm::PPCII::MO_TPREL_HA, llvm::PPCII::MO_TPREL_LO, and llvm::PPCII::MO_TPREL_PCREL_FLAG.
Referenced by getTOCEntryTypeForMO().
|
override |
Definition at line 1466 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMBB(), assert(), llvm::BuildMI(), Cond, DL, llvm::get(), llvm::getImm(), getReg(), MBB, llvm::PPC::PRED_BIT_SET, llvm::PPC::PRED_BIT_UNSET, and TBB.
|
override |
Definition at line 1230 of file PPCInstrInfo.cpp.
References llvm::BuildMI(), llvm::PPC::DIR_PWR6, llvm::PPC::DIR_PWR7, llvm::PPC::DIR_PWR8, llvm::PPC::DIR_PWR9, DL, llvm::get(), MBB, and MI.
|
override |
Definition at line 1565 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), Cond, llvm::get(), getReg(), MBB, MI, MRI, llvm::PPC::PRED_BIT_SET, llvm::PPC::PRED_BIT_UNSET, llvm::PPC::PRED_EQ, llvm::PPC::PRED_EQ_MINUS, llvm::PPC::PRED_EQ_PLUS, llvm::PPC::PRED_GE, llvm::PPC::PRED_GE_MINUS, llvm::PPC::PRED_GE_PLUS, llvm::PPC::PRED_GT, llvm::PPC::PRED_GT_MINUS, llvm::PPC::PRED_GT_PLUS, llvm::PPC::PRED_LE, llvm::PPC::PRED_LE_MINUS, llvm::PPC::PRED_LE_PLUS, llvm::PPC::PRED_LT, llvm::PPC::PRED_LT_MINUS, llvm::PPC::PRED_LT_PLUS, llvm::PPC::PRED_NE, llvm::PPC::PRED_NE_MINUS, llvm::PPC::PRED_NE_PLUS, llvm::PPC::PRED_NU, llvm::PPC::PRED_NU_MINUS, llvm::PPC::PRED_NU_PLUS, llvm::PPC::PRED_UN, llvm::PPC::PRED_UN_MINUS, and llvm::PPC::PRED_UN_PLUS.
| bool PPCInstrInfo::instrHasImmForm | ( | unsigned | Opc, |
| bool | IsVFReg, | ||
| ImmInstrInfo & | III, | ||
| bool | PostRA ) const |
Definition at line 3997 of file PPCInstrInfo.cpp.
References llvm::ImmInstrInfo::ImmMustBeMultipleOf, llvm::ImmInstrInfo::ImmOpcode, llvm::ImmInstrInfo::ImmOpNo, llvm::ImmInstrInfo::ImmWidth, llvm::ImmInstrInfo::IsCommutative, llvm::ImmInstrInfo::IsSummingOperands, llvm_unreachable, Opc, llvm::ImmInstrInfo::OpNoForForwarding, llvm::ImmInstrInfo::SignedImm, llvm::ImmInstrInfo::TruncateImmTo, llvm::ImmInstrInfo::ZeroIsSpecialNew, and llvm::ImmInstrInfo::ZeroIsSpecialOrig.
Referenced by convertToImmediateForm(), and isImmInstrEligibleForFolding().
| bool PPCInstrInfo::isADDIInstrEligibleForFolding | ( | MachineInstr & | ADDIMI, |
| int64_t & | Imm ) const |
Definition at line 3686 of file PPCInstrInfo.cpp.
References llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::isImm(), and Opc.
Referenced by isValidToBeChangedReg().
| bool PPCInstrInfo::isADDInstrEligibleForFolding | ( | MachineInstr & | ADDMI | ) | const |
Definition at line 3703 of file PPCInstrInfo.cpp.
References llvm::MachineInstr::getOpcode(), and Opc.
Referenced by foldFrameOffset().
|
override |
Definition at line 232 of file PPCInstrInfo.cpp.
References llvm::MachineInstr::FmNsz, llvm::MachineInstr::FmReassoc, llvm::MachineInstr::getFlag(), and llvm::MachineInstr::getOpcode().
Check Opcode is BDNZ (Decrement CTR and branch if it is still nonzero).
Definition at line 5689 of file PPCInstrInfo.cpp.
Referenced by analyzeLoopForPipelining().
|
override |
Definition at line 1047 of file PPCInstrInfo.cpp.
References MI.
| bool PPCInstrInfo::isImmInstrEligibleForFolding | ( | MachineInstr & | MI, |
| unsigned & | BaseReg, | ||
| unsigned & | XFormOpcode, | ||
| int64_t & | OffsetOfImmInstr, | ||
| ImmInstrInfo & | III ) const |
Definition at line 3710 of file PPCInstrInfo.cpp.
References assert(), llvm::MachineOperand::getImm(), llvm::MachineOperand::getReg(), llvm::ImmInstrInfo::ImmOpNo, instrHasImmForm(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isReg(), llvm::ImmInstrInfo::IsSummingOperands, llvm::PPC::isVFRegister(), MI, Opc, and llvm::ImmInstrInfo::OpNoForForwarding.
Referenced by foldFrameOffset().
| bool PPCInstrInfo::isLoadFromConstantPool | ( | MachineInstr * | I | ) | const |
Definition at line 655 of file PPCInstrInfo.cpp.
References llvm::PseudoSourceValue::ConstantPool, and I.
Referenced by getFMAPatterns().
|
override |
Definition at line 1062 of file PPCInstrInfo.cpp.
References llvm::is_contained(), and MI.
Definition at line 395 of file PPCInstrInfo.h.
References llvm::get(), and llvm::PPCII::MemriOp.
|
override |
Definition at line 2204 of file PPCInstrInfo.cpp.
References MI.
Definition at line 386 of file PPCInstrInfo.h.
References llvm::get(), and llvm::PPCII::Prefixed.
|
inlineoverride |
Definition at line 628 of file PPCInstrInfo.h.
References MBB.
|
inlineoverride |
Definition at line 616 of file PPCInstrInfo.h.
References MBB.
|
override |
Definition at line 2195 of file PPCInstrInfo.cpp.
References MBBDefinesCTR().
|
inlineoverride |
Definition at line 633 of file PPCInstrInfo.h.
|
override |
Definition at line 1078 of file PPCInstrInfo.cpp.
References llvm::TargetInstrInfo::isReMaterializableImpl(), and MI.
Definition at line 399 of file PPCInstrInfo.h.
|
override |
Definition at line 2215 of file PPCInstrInfo.cpp.
References llvm::TargetInstrInfo::isSchedulingBoundary(), MBB, and MI.
Definition at line 389 of file PPCInstrInfo.h.
References llvm::get(), and llvm::PPCII::SExt32To64.
|
inline |
Definition at line 727 of file PPCInstrInfo.h.
References isSignOrZeroExtended(), MRI, and Reg.
Referenced by optimizeCompareInstr().
| std::pair< bool, bool > PPCInstrInfo::isSignOrZeroExtended | ( | const unsigned | Reg, |
| const unsigned | BinOpDepth, | ||
| const MachineRegisterInfo * | MRI ) const |
Definition at line 5521 of file PPCInstrInfo.cpp.
References definedBySignExtendingOp(), definedByZeroExtendingOp(), llvm::dyn_cast(), llvm::dyn_cast_if_present(), llvm::Function::getAttributes(), llvm::Function::getEntryBlock(), llvm::MachineFunction::getFunction(), llvm::MachineOperand::getGlobal(), llvm::MachineFunction::getInfo(), llvm::MachineInstr::getOperand(), llvm::MachineFunction::getRegInfo(), llvm::Function::getReturnType(), llvm::MachineFunction::getSubtarget(), I, II, llvm::MachineInstr::isCall(), llvm::MachineOperand::isGlobal(), llvm::MachineRegisterInfo::isLiveIn(), llvm::PPCFunctionInfo::isLiveInSExt(), llvm::PPCFunctionInfo::isLiveInZExt(), isSignOrZeroExtended(), llvm::PPCSubtarget::isSVR4ABI(), llvm::Register::isVirtualRegister(), MAX_BINOP_DEPTH, MBB, MI, and MRI.
Referenced by isSignExtended(), isSignOrZeroExtended(), and isZeroExtended().
|
override |
Definition at line 1118 of file PPCInstrInfo.cpp.
References llvm::is_contained(), and MI.
| bool PPCInstrInfo::isTOCSaveMI | ( | const MachineInstr & | MI | ) | const |
Definition at line 5291 of file PPCInstrInfo.cpp.
| bool PPCInstrInfo::isValidToBeChangedReg | ( | MachineInstr * | ADDMI, |
| unsigned | Index, | ||
| MachineInstr *& | ADDIMI, | ||
| int64_t & | OffsetAddi, | ||
| int64_t | OffsetImm ) const |
Definition at line 3753 of file PPCInstrInfo.cpp.
References assert(), getDefMIPostRA(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), isADDIInstrEligibleForFolding(), llvm::isInt(), and llvm::MachineOperand::isKill().
Referenced by foldFrameOffset().
Definition at line 383 of file PPCInstrInfo.h.
References llvm::get(), and llvm::PPCII::XFormMemOp.
|
inline |
Definition at line 733 of file PPCInstrInfo.h.
References isSignOrZeroExtended(), MRI, and Reg.
Referenced by optimizeCompareInstr().
Definition at line 392 of file PPCInstrInfo.h.
References llvm::get(), and llvm::PPCII::ZExt32To64.
|
override |
Definition at line 2080 of file PPCInstrInfo.cpp.
References loadRegFromStackSlotNoUpd(), MBB, MI, and updatedRC().
| void PPCInstrInfo::loadRegFromStackSlotNoUpd | ( | MachineBasicBlock & | MBB, |
| MachineBasicBlock::iterator | MBBI, | ||
| unsigned | DestReg, | ||
| int | FrameIndex, | ||
| const TargetRegisterClass * | RC ) const |
Definition at line 2059 of file PPCInstrInfo.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::back(), DL, llvm::MachinePointerInfo::getFixedStack(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineFrameInfo::getObjectAlign(), llvm::MachineFrameInfo::getObjectSize(), MBB, MI, and llvm::MachineMemOperand::MOLoad.
Referenced by loadRegFromStackSlot().
| void PPCInstrInfo::materializeImmPostRA | ( | MachineBasicBlock & | MBB, |
| MachineBasicBlock::iterator | MBBI, | ||
| const DebugLoc & | DL, | ||
| Register | Reg, | ||
| int64_t | Imm ) const |
Definition at line 3417 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), DL, llvm::get(), llvm::isInt(), llvm::RegState::Kill, MBB, and MBBI.
| bool PPCInstrInfo::onlyFoldImmediate | ( | MachineInstr & | UseMI, |
| MachineInstr & | DefMI, | ||
| Register | Reg ) const |
Definition at line 2112 of file PPCInstrInfo.cpp.
References assert(), llvm::dbgs(), DefMI, llvm::MCInstrDesc::getNumOperands(), llvm::MCInstrDesc::isPseudo(), LLVM_DEBUG, llvm::MCInstrDesc::operands(), and UseMI.
Referenced by foldImmediate().
| bool PPCInstrInfo::optimizeCmpPostRA | ( | MachineInstr & | MI | ) | const |
Definition at line 2817 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::addReg(), analyzeCompare(), assert(), llvm::MachineInstr::clearRegisterDeads(), llvm::dbgs(), llvm::MachineInstr::definesRegister(), llvm::MachineInstr::dump(), llvm::get(), getDefMIPostRA(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::MachineInstr::hasImplicitDef(), llvm::RegState::ImplicitDefine, LLVM_DEBUG, MRI, Opc, and llvm::MachineInstr::setDesc().
|
override |
Definition at line 2432 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::addReg(), assert(), B(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::MachineOperand::CreateReg(), DisableCmpOpt, llvm::MachineBasicBlock::end(), llvm::MachineInstr::eraseFromParent(), llvm::get(), llvm::PPC::getNonRecordFormOpcode(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), llvm::PPC::getPredicate(), llvm::PPC::getPredicateCondition(), llvm::PPC::getPredicateHint(), llvm::MachineOperand::getReg(), getRegisterInfo(), llvm::PPC::getSwappedPredicate(), I, llvm::MCInstrDesc::implicit_defs(), llvm::MCInstrDesc::implicit_uses(), isSignExtended(), llvm::Register::isVirtual(), isZeroExtended(), llvm::RegState::Kill, MI, MRI, llvm::MachineInstr::NoSWrap, llvm::PPC::PRED_EQ, llvm::PPC::PRED_GE, llvm::PPC::PRED_GT, llvm::PPC::PRED_LE, llvm::PPC::PRED_LT, llvm::PPC::PRED_NE, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::MachineOperand::setImm(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::Sub, TRI, and UseMI.
|
override |
Definition at line 2232 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), llvm::get(), llvm::getImm(), getReg(), llvm::RegState::Implicit, llvm::RegState::ImplicitDefine, llvm_unreachable, MBB, MI, llvm::PPC::PRED_BIT_SET, and llvm::PPC::PRED_BIT_UNSET.
| void PPCInstrInfo::promoteInstr32To64ForElimEXTSW | ( | const Register & | Reg, |
| MachineRegisterInfo * | MRI, | ||
| unsigned | BinOpDepth, | ||
| LiveVariables * | LV ) const |
Definition at line 5317 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstr::addOperand(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), DL, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getSubtarget(), I, llvm::MachineOperand::isReg(), llvm::PPCSubtarget::isSVR4ABI(), llvm::Register::isVirtual(), llvm::RegState::Kill, MAX_BINOP_DEPTH, MBB, MI, MRI, PPCInstrInfo(), promoteInstr32To64ForElimEXTSW(), llvm::LiveVariables::recomputeForSingleDefVirtReg(), TII, and TRI.
Referenced by promoteInstr32To64ForElimEXTSW().
|
override |
Definition at line 1434 of file PPCInstrInfo.cpp.
| void PPCInstrInfo::replaceInstrOperandWithImm | ( | MachineInstr & | MI, |
| unsigned | OpNo, | ||
| int64_t | Imm ) const |
Definition at line 3346 of file PPCInstrInfo.cpp.
References assert(), getRegisterInfo(), llvm::MachineOperand::isImplicit(), MI, and TRI.
| void PPCInstrInfo::replaceInstrWithLI | ( | MachineInstr & | MI, |
| const LoadImmediateInfo & | LII ) const |
Definition at line 3377 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::get(), llvm::LoadImmediateInfo::Imm, llvm::RegState::ImplicitDefine, llvm::LoadImmediateInfo::Is64Bit, MI, and llvm::LoadImmediateInfo::SetCR.
|
override |
Definition at line 2098 of file PPCInstrInfo.cpp.
References assert(), Cond, llvm::getImm(), getReg(), and llvm::PPC::InvertPredicate().
| void PPCInstrInfo::setSpecialOperandAttr | ( | MachineInstr & | MI, |
| uint32_t | Flags ) const |
Definition at line 219 of file PPCInstrInfo.cpp.
References llvm::MachineInstr::IsExact, MI, llvm::MachineInstr::NoSWrap, and llvm::MachineInstr::NoUWrap.
|
inline |
This is an architecture-specific helper function of reassociateOps.
Set special operand attributes for new instructions after reassociation.
Definition at line 1429 of file TargetInstrInfo.h.
|
override |
Returns true if the two given memory operations should be scheduled adjacent.
Definition at line 2943 of file PPCInstrInfo.cpp.
References assert(), llvm::ArrayRef< T >::front(), llvm::MachineOperand::getIndex(), getMemOperandWithOffsetWidth(), llvm::MachineInstr::getOpcode(), llvm::MachineOperand::getParent(), llvm::MachineOperand::getReg(), getRegisterInfo(), llvm::LocationSize::getValue(), isClusterableLdStOpcPair(), llvm::MachineOperand::isFI(), isLdStSafeToCluster(), llvm::MachineOperand::isReg(), llvm::LocationSize::precise(), llvm::ArrayRef< T >::size(), and TRI.
|
override |
On PowerPC, we leverage machine combiner pass to reduce register pressure when the register pressure is high for one BB.
Return true if register pressure for MBB is high and ABI is supported to reduce register pressure. Otherwise return false.
Definition at line 595 of file PPCInstrInfo.cpp.
References assert(), llvm::RegPressureTracker::closeRegion(), llvm::RegisterOperands::collect(), EnableFMARegPressureReduction, FMARPFactor, llvm::RegPressureTracker::getPos(), llvm::RegPressureTracker::getPressure(), llvm::MachineFunction::getRegInfo(), getRegisterInfo(), llvm::RegisterClassInfo::getRegPressureSetLimit(), llvm::RegPressureTracker::init(), llvm::RegisterPressure::MaxSetPressure, MBB, llvm::CodeModel::Medium, MI, MRI, llvm::RegPressureTracker::recede(), llvm::RegPressureTracker::recedeSkipDebugValues(), llvm::reverse(), and TRI.
|
override |
Definition at line 2034 of file PPCInstrInfo.cpp.
References MBB, MI, storeRegToStackSlotNoUpd(), and updatedRC().
| void PPCInstrInfo::storeRegToStackSlotNoUpd | ( | MachineBasicBlock & | MBB, |
| MachineBasicBlock::iterator | MBBI, | ||
| unsigned | SrcReg, | ||
| bool | isKill, | ||
| int | FrameIndex, | ||
| const TargetRegisterClass * | RC ) const |
Definition at line 2015 of file PPCInstrInfo.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::MachinePointerInfo::getFixedStack(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineFrameInfo::getObjectAlign(), llvm::MachineFrameInfo::getObjectSize(), MBB, MI, and llvm::MachineMemOperand::MOStore.
Referenced by storeRegToStackSlot().
|
override |
Definition at line 2336 of file PPCInstrInfo.cpp.
References assert(), llvm::getImm(), getReg(), llvm::PPC::PRED_EQ, llvm::PPC::PRED_GE, llvm::PPC::PRED_GT, llvm::PPC::PRED_LE, llvm::PPC::PRED_LT, and llvm::ArrayRef< T >::size().
| const TargetRegisterClass * PPCInstrInfo::updatedRC | ( | const TargetRegisterClass * | RC | ) | const |
Definition at line 5172 of file PPCInstrInfo.cpp.
Referenced by loadRegFromStackSlot(), and storeRegToStackSlot().
|
inlineoverride |
Definition at line 469 of file PPCInstrInfo.h.