|
LLVM 24.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 280 of file PPCInstrInfo.h.
|
explicit |
Definition at line 96 of file PPCInstrInfo.cpp.
|
override |
Definition at line 1246 of file PPCInstrInfo.cpp.
References Cond, llvm::MachineOperand::CreateImm(), llvm::MachineOperand::CreateReg(), EnableCTRLoopAnal, 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 2389 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 5794 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 5850 of file PPCInstrInfo.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 1506 of file PPCInstrInfo.cpp.
References Cond, getReg(), isPhysical(), MBB, and MRI.
|
override |
Definition at line 2354 of file PPCInstrInfo.cpp.
References llvm::MCRegisterClass::contains(), and MI.
| bool PPCInstrInfo::combineRLWINM | ( | MachineInstr & | MI, |
| MachineInstr ** | ToErase = nullptr ) const |
Definition at line 3898 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 1117 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::TargetInstrInfo::commuteInstructionImpl(), llvm::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 3835 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 1665 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), contains(), llvm::Define, DL, llvm::PPCRegisterInfo::emitAccCopyInfo(), llvm::get(), getCRBitValue(), llvm::getCRFromCRBit(), llvm::getKillRegState(), I, llvm::Implicit, llvm::ImplicitDefine, llvm::Kill, llvm_unreachable, MBB, Opc, and VSXSelfCopyCrash.
|
override |
CreateTargetHazardRecognizer - Return the hazard recognizer to use for this target when scheduling the DAG.
Definition at line 111 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 128 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 3057 of file PPCInstrInfo.cpp.
| bool PPCInstrInfo::expandAMOCSNEPseudo | ( | MachineInstr & | MI | ) | const |
Definition at line 5886 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), DL, llvm::get(), llvm::Implicit, MBB, MI, and Register.
Referenced by expandPostRAPseudo().
|
override |
Definition at line 3168 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), contains(), DL, expandAMOCSNEPseudo(), 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 3102 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 534 of file PPCInstrInfo.cpp.
References assert(), C(), llvm::APFloat::changeSign(), llvm::dyn_cast(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), FMAOpIdxInfo, getConstantFromConstantPool(), llvm::MachineFunction::getConstantPool(), llvm::MachineConstantPool::getConstantPoolIndex(), getContext(), llvm::MachineFunction::getDataLayout(), llvm::MachineInstr::getMF(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::DataLayout::getPrefTypeAlign(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), InfoArrayIdxMULOpIdx, llvm::isa(), MRI, llvm::REASSOC_XY_BAC, and llvm::REASSOC_XY_BCA.
|
override |
Definition at line 1201 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 5814 of file PPCInstrInfo.cpp.
References I, and llvm::MachineBasicBlock::instrs().
Referenced by analyzeLoopForPipelining().
| bool PPCInstrInfo::foldFrameOffset | ( | MachineInstr & | MI | ) | const |
Definition at line 3626 of file PPCInstrInfo.cpp.
References assert(), llvm::dbgs(), llvm::MachineInstr::dump(), llvm::End, 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 2160 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 774 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 746 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 726 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 3437 of file PPCInstrInfo.cpp.
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 524 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 361 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(), 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, and llvm::REASSOC_XY_BCA.
Referenced by getMachineCombinerPatterns().
|
override |
Definition at line 102 of file PPCInstrInfo.cpp.
References C().
|
override |
Definition at line 148 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 3007 of file PPCInstrInfo.cpp.
References F, llvm::get(), llvm::MachineFunction::getFunction(), llvm::TargetMachine::getMCAsmInfo(), llvm::PatchPointOpers::getNumPatchBytes(), llvm::StackMapOpers::getNumPatchBytes(), llvm::MachineFunction::getTarget(), llvm::TargetMachine::getTargetTriple(), llvm::Triple::isLittleEndian(), llvm::Triple::isOSAIX(), and MI.
|
override |
Definition at line 3049 of file PPCInstrInfo.cpp.
References MI.
| unsigned PPCInstrInfo::getLoadOpcodeForSpill | ( | const TargetRegisterClass * | RC | ) | const |
Definition at line 1975 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 759 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 2897 of file PPCInstrInfo.cpp.
References getMemOperandWithOffsetWidth(), llvm::Offset, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
| bool PPCInstrInfo::getMemOperandWithOffsetWidth | ( | const MachineInstr & | LdSt, |
| const MachineOperand *& | BaseOp, | ||
| int64_t & | Offset, | ||
| LocationSize & | Width ) 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 5829 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(), and llvm::Offset.
Referenced by areMemAccessesTriviallyDisjoint(), getMemOperandsWithOffsetWidth(), and shouldClusterMemOps().
|
override |
Return the noop instruction to use for a noop.
Definition at line 1237 of file PPCInstrInfo.cpp.
References llvm::MCInst::setOpcode().
|
override |
Definition at line 178 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 455 of file PPCInstrInfo.h.
|
static |
Definition at line 5224 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 foldFrameOffset(), and llvm::PPCSubtarget::getRegisterInfo().
|
override |
Definition at line 3063 of file PPCInstrInfo.cpp.
References llvm::ArrayRef().
| unsigned PPCInstrInfo::getStoreOpcodeForSpill | ( | const TargetRegisterClass * | RC | ) | const |
Definition at line 1969 of file PPCInstrInfo.cpp.
Definition at line 421 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 463 of file PPCInstrInfo.h.
References DefMI.
Definition at line 413 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 428 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 1453 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 1217 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 1552 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 4037 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 3723 of file PPCInstrInfo.cpp.
References llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), Imm, llvm::MachineOperand::isImm(), and Opc.
Referenced by isValidToBeChangedReg().
| bool PPCInstrInfo::isADDInstrEligibleForFolding | ( | MachineInstr & | ADDMI | ) | const |
Definition at line 3740 of file PPCInstrInfo.cpp.
References llvm::MachineInstr::getOpcode(), and Opc.
Referenced by foldFrameOffset().
|
override |
Definition at line 243 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 5716 of file PPCInstrInfo.cpp.
Referenced by analyzeLoopForPipelining().
|
override |
Definition at line 1034 of file PPCInstrInfo.cpp.
References MI.
| bool PPCInstrInfo::isImmInstrEligibleForFolding | ( | MachineInstr & | MI, |
| unsigned & | BaseReg, | ||
| unsigned & | XFormOpcode, | ||
| int64_t & | OffsetOfImmInstr, | ||
| ImmInstrInfo & | III ) const |
Definition at line 3747 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 662 of file PPCInstrInfo.cpp.
References llvm::PseudoSourceValue::ConstantPool, and I.
Referenced by getFMAPatterns().
|
override |
Definition at line 1049 of file PPCInstrInfo.cpp.
References llvm::is_contained(), and MI.
Definition at line 398 of file PPCInstrInfo.h.
References llvm::get(), and llvm::PPCII::MemriOp.
|
override |
Definition at line 2191 of file PPCInstrInfo.cpp.
References MI.
Definition at line 389 of file PPCInstrInfo.h.
References llvm::get(), and llvm::PPCII::Prefixed.
|
inlineoverride |
Definition at line 630 of file PPCInstrInfo.h.
References MBB.
|
inlineoverride |
Definition at line 618 of file PPCInstrInfo.h.
References MBB.
|
override |
Definition at line 2182 of file PPCInstrInfo.cpp.
References MBBDefinesCTR().
|
inlineoverride |
Definition at line 635 of file PPCInstrInfo.h.
|
override |
Definition at line 1065 of file PPCInstrInfo.cpp.
References llvm::TargetInstrInfo::isReMaterializableImpl(), and MI.
Definition at line 402 of file PPCInstrInfo.h.
|
override |
Definition at line 2202 of file PPCInstrInfo.cpp.
References llvm::TargetInstrInfo::isSchedulingBoundary(), MBB, and MI.
Definition at line 392 of file PPCInstrInfo.h.
References llvm::get(), and llvm::PPCII::SExt32To64.
Referenced by promoteInstr32To64ForElimEXTSW().
|
inline |
Definition at line 731 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 5548 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, Imm, 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 1105 of file PPCInstrInfo.cpp.
References llvm::is_contained(), and MI.
| bool PPCInstrInfo::isTOCSaveMI | ( | const MachineInstr & | MI | ) | const |
Definition at line 5335 of file PPCInstrInfo.cpp.
| bool PPCInstrInfo::isValidToBeChangedReg | ( | MachineInstr * | ADDMI, |
| unsigned | Index, | ||
| MachineInstr *& | ADDIMI, | ||
| int64_t & | OffsetAddi, | ||
| int64_t | OffsetImm ) const |
Definition at line 3790 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 386 of file PPCInstrInfo.h.
References llvm::get(), and llvm::PPCII::XFormMemOp.
|
inline |
Definition at line 737 of file PPCInstrInfo.h.
References isSignOrZeroExtended(), MRI, and Reg.
Referenced by optimizeCompareInstr().
Definition at line 395 of file PPCInstrInfo.h.
References llvm::get(), and llvm::PPCII::ZExt32To64.
|
override |
Definition at line 2067 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 2046 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 3453 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), DL, llvm::get(), Imm, llvm::isInt(), llvm::Kill, MBB, and MBBI.
| bool PPCInstrInfo::onlyFoldImmediate | ( | MachineInstr & | UseMI, |
| MachineInstr & | DefMI, | ||
| Register | Reg ) const |
Definition at line 2099 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 2822 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::ImplicitDefine, LLVM_DEBUG, MRI, Opc, and llvm::MachineInstr::setDesc().
|
override |
Definition at line 2419 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::addReg(), assert(), B(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::MachineOperand::CreateReg(), EnableCmpOpt, llvm::MachineBasicBlock::end(), llvm::MachineInstr::eraseFromParent(), llvm::get(), llvm::getKillRegState(), llvm::PPC::getNonRecordFormOpcode(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), llvm::PPC::getPredicate(), llvm::PPC::getPredicateCondition(), llvm::PPC::getPredicateHint(), llvm::MachineOperand::getReg(), llvm::PPC::getSwappedPredicate(), I, llvm::MCInstrDesc::implicit_defs(), llvm::MCInstrDesc::implicit_uses(), isSignExtended(), llvm::Register::isVirtual(), isZeroExtended(), llvm::MachineBasicBlock::LQR_Dead, MBB, 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, and UseMI.
|
override |
Definition at line 2219 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), llvm::get(), llvm::getImm(), getReg(), llvm::Implicit, llvm::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 ) const |
Definition at line 5361 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), DL, llvm::DenseMapBase< StorageT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< StorageT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::get(), llvm::MachineOperand::getReg(), llvm::MachineOperand::getSubReg(), llvm::MachineFunction::getSubtarget(), llvm::MCRegisterClass::hasSubClassEq(), I, llvm::MachineOperand::isReg(), isSExt32To64(), llvm::PPCSubtarget::isSVR4ABI(), llvm::Register::isVirtual(), MAX_BINOP_DEPTH, MBB, MI, MRI, promoteInstr32To64ForElimEXTSW(), llvm::MachineOperand::setReg(), and llvm::MachineOperand::setSubReg().
Referenced by promoteInstr32To64ForElimEXTSW().
|
override |
Definition at line 1421 of file PPCInstrInfo.cpp.
| void PPCInstrInfo::replaceInstrOperandWithImm | ( | MachineInstr & | MI, |
| unsigned | OpNo, | ||
| int64_t | Imm ) const |
Definition at line 3384 of file PPCInstrInfo.cpp.
References assert(), Imm, llvm::MachineOperand::isImplicit(), and MI.
| void PPCInstrInfo::replaceInstrWithLI | ( | MachineInstr & | MI, |
| const LoadImmediateInfo & | LII ) const |
Definition at line 3414 of file PPCInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::get(), llvm::LoadImmediateInfo::Imm, llvm::ImplicitDefine, llvm::LoadImmediateInfo::Is64Bit, MI, and llvm::LoadImmediateInfo::SetCR.
|
override |
Definition at line 2085 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 230 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 1465 of file TargetInstrInfo.h.
|
override |
Returns true if the two given memory operations should be scheduled adjacent.
Definition at line 2947 of file PPCInstrInfo.cpp.
References assert(), llvm::ArrayRef< T >::front(), llvm::MachineOperand::getIndex(), getMemOperandWithOffsetWidth(), llvm::MachineInstr::getOpcode(), llvm::MachineOperand::getParent(), llvm::MachineOperand::getReg(), llvm::LocationSize::getValue(), isClusterableLdStOpcPair(), llvm::MachineOperand::isFI(), isLdStSafeToCluster(), llvm::MachineOperand::isReg(), llvm::LocationSize::precise(), and llvm::ArrayRef< T >::size().
|
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 603 of file PPCInstrInfo.cpp.
References assert(), llvm::RegPressureTracker::closeRegion(), llvm::RegisterOperands::collect(), EnableFMARegPressureReduction, FMARPFactor, llvm::RegPressureTracker::getPos(), llvm::RegPressureTracker::getPressure(), llvm::MachineFunction::getRegInfo(), llvm::RegisterClassInfo::getRegPressureSetLimit(), llvm::RegPressureTracker::init(), llvm::RegisterPressure::MaxSetPressure, MBB, llvm::CodeModel::Medium, MI, MRI, llvm::RegPressureTracker::recede(), llvm::RegPressureTracker::recedeSkipDebugValues(), and llvm::reverse().
|
override |
Definition at line 2021 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 2002 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 2323 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 5218 of file PPCInstrInfo.cpp.
Referenced by loadRegFromStackSlot(), and storeRegToStackSlot().
|
inlineoverride |
Definition at line 472 of file PPCInstrInfo.h.