13 #ifndef LLVM_LIB_TARGET_POWERPC_PPCINSTRINFO_H 14 #define LLVM_LIB_TARGET_POWERPC_PPCINSTRINFO_H 19 #define GET_INSTRINFO_HEADER 20 #include "PPCGenInstrInfo.inc" 116 void StoreRegToStackSlot(
MachineFunction &MF,
unsigned SrcReg,
bool isKill,
120 unsigned DestReg,
int FrameIdx,
133 bool KillDefMI)
const;
140 unsigned &OpNoForForwarding,
141 bool &SeenIntermediateUse)
const;
146 unsigned OpNoForForwarding)
const;
158 bool &IsFwdFeederRegKilled)
const;
159 const unsigned *getStoreOpcodesForSpillArray()
const;
160 const unsigned *getLoadOpcodesForSpillArray()
const;
161 virtual void anchor();
176 unsigned OpIdx2)
const override;
191 unsigned CopyOpcodes[] =
192 {
PPC::OR, PPC::OR8, PPC::FMR, PPC::VOR, PPC::XXLOR, PPC::XXLORf,
193 PPC::XSCPSGNDP, PPC::MCRF, PPC::QVFMR, PPC::QVFMRs, PPC::QVFMRb,
194 PPC::CROR, PPC::EVOR, -1U };
195 for (
int i = 0; CopyOpcodes[i] != -1U; i++)
196 if (Opcode == CopyOpcodes[i])
210 unsigned *PredCost =
nullptr)
const override;
215 unsigned UseIdx)
const override;
217 SDNode *DefNode,
unsigned DefIdx,
218 SDNode *UseNode,
unsigned UseIdx)
const override {
219 return PPCGenInstrInfo::getOperandLatency(ItinData, DefNode, DefIdx,
225 unsigned DefIdx)
const override {
239 bool getMachineCombinerPatterns(
243 bool isAssociativeAndCommutative(
const MachineInstr &Inst)
const override;
246 unsigned &SrcReg,
unsigned &DstReg,
247 unsigned &SubIdx)
const override;
250 bool isReallyTriviallyReMaterializable(
const MachineInstr &MI,
253 int &FrameIndex)
const override;
255 bool findCommutedOpIndices(
const MachineInstr &MI,
unsigned &SrcOpIdx1,
256 unsigned &SrcOpIdx2)
const override;
266 bool AllowModify)
const override;
268 int *BytesRemoved =
nullptr)
const override;
272 int *BytesAdded =
nullptr)
const override;
276 unsigned,
unsigned,
int &,
int &,
int &)
const override;
278 const DebugLoc &DL,
unsigned DstReg,
280 unsigned FalseReg)
const override;
284 bool KillSrc)
const override;
288 unsigned SrcReg,
bool isKill,
int FrameIndex,
294 unsigned DestReg,
int FrameIndex,
298 unsigned getStoreOpcodeForSpill(
unsigned Reg,
301 unsigned getLoadOpcodeForSpill(
unsigned Reg,
314 unsigned NumCycles,
unsigned ExtraPredCycles,
320 unsigned NumT,
unsigned ExtraT,
322 unsigned NumF,
unsigned ExtraF,
338 bool isUnpredicatedTerminator(
const MachineInstr &MI)
const override;
347 std::vector<MachineOperand> &Pred)
const override;
351 bool analyzeCompare(
const MachineInstr &MI,
unsigned &SrcReg,
352 unsigned &SrcReg2,
int &
Mask,
int &
Value)
const override;
354 bool optimizeCompareInstr(
MachineInstr &CmpInstr,
unsigned SrcReg,
355 unsigned SrcReg2,
int Mask,
int Value,
362 bool getMemOperandWithOffsetWidth(
const MachineInstr &LdSt,
370 areMemAccessesTriviallyDisjoint(
const MachineInstr &MIa,
376 unsigned getInstSizeInBytes(
const MachineInstr &MI)
const override;
378 void getNoop(
MCInst &NopInst)
const override;
380 std::pair<unsigned, unsigned>
381 decomposeMachineOperandsTargetFlags(
unsigned TF)
const override;
384 getSerializableDirectMachineOperandTargetFlags()
const override;
387 getSerializableBitmaskMachineOperandTargetFlags()
const override;
393 bool expandPostRAPseudo(
MachineInstr &MI)
const override;
396 return Reg >= PPC::VF0 && Reg <= PPC::VF31;
399 return Reg >= PPC::V0 && Reg <= PPC::V31;
402 static int getRecordFormOpcode(
unsigned Opcode);
406 bool isSignOrZeroExtended(
const MachineInstr &MI,
bool SignExt,
407 const unsigned PhiDepth)
const;
412 return isSignOrZeroExtended(MI,
true, depth);
418 return isSignOrZeroExtended(MI,
false, depth);
424 bool isADDIInstrEligibleForFolding(
MachineInstr &ADDIMI, int64_t &Imm)
const;
425 bool isADDInstrEligibleForFolding(
MachineInstr &ADDMI)
const;
426 bool isImmInstrEligibleForFolding(
MachineInstr &MI,
unsigned &BaseReg,
427 unsigned &XFormOpcode,
428 int64_t &OffsetOfImmInstr,
432 int64_t OffsetImm)
const;
444 unsigned RegNo)
const;
446 void replaceInstrOperandWithImm(
MachineInstr &MI,
unsigned OpNo,
449 bool instrHasImmForm(
unsigned Opc,
bool IsVFReg,
ImmInstrInfo &III,
455 bool &SeenIntermediateUse)
const;
471 case PPC::VSSRCRegClassID:
472 case PPC::VSFRCRegClassID:
473 if (isVFRegister(Reg))
474 return PPC::VSX32 + (Reg - PPC::VF0);
478 case PPC::VSRCRegClassID:
479 if (isVRRegister(Reg))
480 return PPC::VSX32 + (Reg - PPC::V0);
490 bool isBDNZ(
unsigned Opcode)
const;
502 std::unique_ptr<TargetInstrInfo::PipelinerLoopInfo>
Wrapper class representing physical registers. Should be passed by value.
PPC970_Single - This instruction starts a new dispatch group and terminates it, so it will be the sol...
This class represents lattice values for constants.
uint64_t ZeroIsSpecialNew
bool useMachineCombiner() const override
Describe properties that are true of each instruction in the target description file.
PPC970_Mask/Shift - This is a bitmask that selects the pipeline type that an instruction is issued to...
These are the various PPC970 execution unit pipelines.
unsigned const TargetRegisterInfo * TRI
uint64_t OpNoForForwarding
uint64_t IsSummingOperands
bool isSignExtended(const MachineInstr &MI, const unsigned depth=0) const
Return true if the output of the instruction is always a sign-extended, i.e.
bool isXFormMemOp(unsigned Opcode) const
static bool isVRRegister(unsigned Reg)
Shift count to bypass PPC970 flags.
bool isProfitableToUnpredicate(MachineBasicBlock &TMBB, MachineBasicBlock &FMBB) const override
Provide an instruction scheduling machine model to CodeGen passes.
PPC970_First - This instruction starts a new dispatch group, so it will always be the first one in th...
uint64_t ZeroIsSpecialOrig
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Itinerary data supplied by a subtarget to be used by a target.
Instances of this class represent a single low-level machine instruction.
This instruction is an X-Form memory operation.
static void foldFrameOffset(MachineBasicBlock::iterator &II, int &Offset, unsigned DstReg)
Fold a frame offset shared between two add instructions into a single one.
PPC970_Cracked - This instruction is cracked into two pieces, requiring two dispatch pipes to be avai...
unsigned const MachineRegisterInfo * MRI
HazardRecognizer - This determines whether or not an instruction can be issued this cycle...
MachineInstrBuilder & UseMI
static bool isSameClassPhysRegCopy(unsigned Opcode)
bool isProfitableToDupForIfCvt(MachineBasicBlock &MBB, unsigned NumCycles, BranchProbability Probability) const override
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
static unsigned getRegNumForOperand(const MCInstrDesc &Desc, unsigned Reg, unsigned OpNo)
getRegNumForOperand - some operands use different numbering schemes for the same registers.
MachineOperand class - Representation of each machine instruction operand.
MachineInstrBuilder MachineInstrBuilder & DefMI
Represents one node in the SelectionDAG.
static bool isVFRegister(unsigned Reg)
bool hasLowDefLatency(const TargetSchedModel &SchedModel, const MachineInstr &DefMI, unsigned DefIdx) const override
bool isPredicated(MCInstrInfo const &MCII, MCInst const &MCI)
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
TargetSubtargetInfo - Generic base class for all target subtargets.
Representation of each machine instruction.
int getOperandLatency(const InstrItineraryData *ItinData, SDNode *DefNode, unsigned DefIdx, SDNode *UseNode, unsigned UseIdx) const override
int16_t RegClass
This specifies the register class enumeration of the operand if the operand is a register.
uint64_t ImmMustBeMultipleOf
LLVM Value Representation.
const MCOperandInfo * OpInfo
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
const PPCRegisterInfo & getRegisterInfo() const
getRegisterInfo - TargetInstrInfo is a superset of MRegister info.
bool isProfitableToIfCvt(MachineBasicBlock &MBB, unsigned NumCycles, unsigned ExtraPredCycles, BranchProbability Probability) const override
bool isZeroExtended(const MachineInstr &MI, const unsigned depth=0) const
Return true if the output of the instruction is always zero-extended, i.e.