14 #ifndef LLVM_LIB_TARGET_POWERPC_PPCINSTRINFO_H 15 #define LLVM_LIB_TARGET_POWERPC_PPCINSTRINFO_H 21 #define GET_INSTRINFO_HEADER 22 #include "PPCGenInstrInfo.inc" 121 void StoreRegToStackSlot(
MachineFunction &MF,
unsigned SrcReg,
bool isKill,
125 unsigned DestReg,
int FrameIdx,
132 unsigned ConstantOpNo, int64_t Imm)
const;
136 unsigned ConstantOpNo,
138 bool KillDefMI)
const;
145 unsigned &OpNoForForwarding,
146 bool &SeenIntermediateUse)
const;
151 unsigned OpNoForForwarding)
const;
163 bool KillDefMI)
const;
164 const unsigned *getStoreOpcodesForSpillArray()
const;
165 const unsigned *getLoadOpcodesForSpillArray()
const;
166 virtual void anchor();
181 unsigned OpIdx2)
const override;
196 unsigned CopyOpcodes[] =
197 {
PPC::OR, PPC::OR8, PPC::FMR, PPC::VOR, PPC::XXLOR, PPC::XXLORf,
198 PPC::XSCPSGNDP, PPC::MCRF, PPC::QVFMR, PPC::QVFMRs, PPC::QVFMRb,
199 PPC::CROR, PPC::EVOR, -1U };
200 for (
int i = 0; CopyOpcodes[i] != -1U; i++)
201 if (Opcode == CopyOpcodes[i])
215 unsigned *PredCost =
nullptr)
const override;
220 unsigned UseIdx)
const override;
222 SDNode *DefNode,
unsigned DefIdx,
223 SDNode *UseNode,
unsigned UseIdx)
const override {
224 return PPCGenInstrInfo::getOperandLatency(ItinData, DefNode, DefIdx,
230 unsigned DefIdx)
const override {
244 bool getMachineCombinerPatterns(
248 bool isAssociativeAndCommutative(
const MachineInstr &Inst)
const override;
251 unsigned &SrcReg,
unsigned &DstReg,
252 unsigned &SubIdx)
const override;
255 bool isReallyTriviallyReMaterializable(
const MachineInstr &MI,
258 int &FrameIndex)
const override;
260 bool findCommutedOpIndices(
MachineInstr &MI,
unsigned &SrcOpIdx1,
261 unsigned &SrcOpIdx2)
const override;
271 bool AllowModify)
const override;
273 int *BytesRemoved =
nullptr)
const override;
277 int *BytesAdded =
nullptr)
const override;
281 unsigned,
unsigned,
int &,
int &,
int &)
const override;
283 const DebugLoc &DL,
unsigned DstReg,
285 unsigned FalseReg)
const override;
288 const DebugLoc &DL,
unsigned DestReg,
unsigned SrcReg,
289 bool KillSrc)
const override;
293 unsigned SrcReg,
bool isKill,
int FrameIndex,
299 unsigned DestReg,
int FrameIndex,
303 unsigned getStoreOpcodeForSpill(
unsigned Reg,
306 unsigned getLoadOpcodeForSpill(
unsigned Reg,
319 unsigned NumCycles,
unsigned ExtraPredCycles,
325 unsigned NumT,
unsigned ExtraT,
327 unsigned NumF,
unsigned ExtraF,
343 bool isUnpredicatedTerminator(
const MachineInstr &MI)
const override;
352 std::vector<MachineOperand> &Pred)
const override;
354 bool isPredicable(
const MachineInstr &MI)
const override;
358 bool analyzeCompare(
const MachineInstr &MI,
unsigned &SrcReg,
359 unsigned &SrcReg2,
int &
Mask,
int &
Value)
const override;
361 bool optimizeCompareInstr(
MachineInstr &CmpInstr,
unsigned SrcReg,
362 unsigned SrcReg2,
int Mask,
int Value,
368 unsigned getInstSizeInBytes(
const MachineInstr &MI)
const override;
370 void getNoop(
MCInst &NopInst)
const override;
372 std::pair<unsigned, unsigned>
373 decomposeMachineOperandsTargetFlags(
unsigned TF)
const override;
376 getSerializableDirectMachineOperandTargetFlags()
const override;
379 getSerializableBitmaskMachineOperandTargetFlags()
const override;
385 bool expandPostRAPseudo(
MachineInstr &MI)
const override;
388 return Reg >= PPC::VF0 && Reg <= PPC::VF31;
391 return Reg >= PPC::V0 && Reg <= PPC::V31;
394 static int getRecordFormOpcode(
unsigned Opcode);
398 bool isSignOrZeroExtended(
const MachineInstr &MI,
bool SignExt,
399 const unsigned PhiDepth)
const;
404 return isSignOrZeroExtended(MI,
true, depth);
410 return isSignOrZeroExtended(MI,
false, depth);
416 void replaceInstrOperandWithImm(
MachineInstr &MI,
unsigned OpNo,
433 if (isVRRegister(Reg))
434 Reg = PPC::VSX32 + (Reg - PPC::V0);
435 else if (isVFRegister(Reg))
436 Reg = PPC::VSX32 + (Reg - PPC::VF0);
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_Single - This instruction starts a new dispatch group and terminates it, so it will be the sol...
These are the various PPC970 execution unit pipelines.
unsigned const TargetRegisterInfo * TRI
uint64_t OpNoForForwarding
Shift count to bypass PPC970 flags.
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)
bool isProfitableToUnpredicate(MachineBasicBlock &TMBB, MachineBasicBlock &FMBB) const override
Provide an instruction scheduling machine model to CodeGen passes.
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.
unsigned const MachineRegisterInfo * MRI
HazardRecognizer - This determines whether or not an instruction can be issued this cycle...
MachineInstrBuilder & UseMI
static ManagedStatic< OptionRegistry > OR
PPC970_First - This instruction starts a new dispatch group, so it will always be the first one in th...
static bool isSameClassPhysRegCopy(unsigned Opcode)
bool isProfitableToDupForIfCvt(MachineBasicBlock &MBB, unsigned NumCycles, BranchProbability Probability) const override
This instruction is an X-Form memory operation.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
static unsigned getRegNumForOperand(const MCInstrDesc &Desc, unsigned Reg, unsigned OpNo)
getRegNumForOperand - some operands use different numbering schemes for the same registers.
PPC970_Mask/Shift - This is a bitmask that selects the pipeline type that an instruction is issued to...
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
uint64_t ImmMustBeMultipleOf
The VSX instruction that uses VSX register (vs0-vs63), instead of VMX register (v0-v31).
LLVM Value Representation.
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
PPC970_Cracked - This instruction is cracked into two pieces, requiring two dispatch pipes to be avai...
bool isZeroExtended(const MachineInstr &MI, const unsigned depth=0) const
Return true if the output of the instruction is always zero-extended, i.e.