54#define DEBUG_TYPE "mips-delay-slot-filler"
56STATISTIC(FilledSlots,
"Number of delay slots filled");
57STATISTIC(UsefulSlots,
"Number of delay slots filled with instructions that"
59STATISTIC(R5900ShortLoopNops,
"Number of delay slots left as NOP for R5900 "
71 class BranchInformation {
91 BranchInformation(MachineInstrBundleIterator<MachineInstr> CurrentSlot,
92 MachineInstrBundleIterator<MachineInstr> MBBEnd,
93 const MachineInstr *NextMBBInstr)
96 ? BranchInformation::filterPseudoInstr(&(*CurrentSlot))
99 (++CurrentSlot) == MBBEnd
100 ? BranchInformation::filterPseudoInstr(NextMBBInstr)
101 : BranchInformation::filterPseudoInstr(&(*CurrentSlot))) {}
104 constexpr bool hasBranchInstr()
const {
return this->BranchInstr; }
107 constexpr bool hasBranchElseInstr()
const {
return this->ElseBranchInstr; }
110 constexpr bool isIndirectBranch()
const {
111 if (this->BranchInstr) {
112 return this->BranchInstr->isIndirectBranch();
118 constexpr bool isUnconditionalBranch()
const {
119 if (this->BranchInstr) {
120 return this->BranchInstr->isUnconditionalBranch();
126 const MachineInstr *getBranchInstr()
const {
return this->BranchInstr; }
129 const MachineInstr *getBranchElseInstr()
const {
130 return this->ElseBranchInstr;
134 const MachineBasicBlock *getBranchTarget()
const {
135 if (this->isIndirectBranch() || !this->hasBranchInstr()) {
140 for (
const MachineOperand &MO : this->BranchInstr->operands()) {
151 RegDefsUses(
const TargetRegisterInfo &TRI);
153 void init(
const MachineInstr &
MI);
156 void setCallerSaved(
const MachineInstr &
MI);
163 void addLiveOut(
const MachineBasicBlock &
MBB,
164 const MachineBasicBlock &SuccBB);
166 bool update(
const MachineInstr &
MI,
unsigned Begin,
unsigned End);
169 bool checkRegDefsUses(BitVector &NewDefs, BitVector &NewUses,
unsigned Reg,
173 bool isRegInSet(
const BitVector &RegSet,
unsigned Reg)
const;
175 const TargetRegisterInfo &TRI;
176 BitVector Defs, Uses;
180 class InspectMemInstr {
182 InspectMemInstr(
bool ForbidMemInstr_) : ForbidMemInstr(ForbidMemInstr_) {}
183 virtual ~InspectMemInstr() =
default;
190 bool OrigSeenLoad =
false;
191 bool OrigSeenStore =
false;
192 bool SeenLoad =
false;
193 bool SeenStore =
false;
200 virtual bool hasHazard_(
const MachineInstr &
MI) = 0;
204 class NoMemInstr :
public InspectMemInstr {
206 NoMemInstr() : InspectMemInstr(
true) {}
209 bool hasHazard_(
const MachineInstr &
MI)
override {
return true; }
213 class LoadFromStackOrConst :
public InspectMemInstr {
215 LoadFromStackOrConst() : InspectMemInstr(
false) {}
218 bool hasHazard_(
const MachineInstr &
MI)
override;
223 class MemDefsUses :
public InspectMemInstr {
225 explicit MemDefsUses(
const MachineFrameInfo *MFI);
228 using ValueType = PointerUnion<const Value *, const PseudoSourceValue *>;
230 bool hasHazard_(
const MachineInstr &
MI)
override;
235 bool updateDefsUses(ValueType
V,
bool MayStore);
239 SmallVectorImpl<ValueType> &Objects)
const;
241 const MachineFrameInfo *MFI;
242 SmallPtrSet<ValueType, 4> Uses, Defs;
246 bool SeenNoObjLoad =
false;
247 bool SeenNoObjStore =
false;
252 MipsDelaySlotFillerLegacy() : MachineFunctionPass(ID) {}
254 StringRef getPassName()
const override {
return "Mips Delay Slot Filler"; }
258 MachineFunctionProperties getRequiredProperties()
const override {
259 return MachineFunctionProperties().setNoVRegs();
262 void getAnalysisUsage(AnalysisUsage &AU)
const override {
263 AU.
addRequired<MachineBranchProbabilityInfoWrapperPass>();
273char MipsDelaySlotFillerLegacy::ID = 0;
276 return MI->hasDelaySlot() && !
MI->isBundledWithSucc();
300 if (!
MI->isBranch() ||
MI->isIndirectBranch())
307 TargetMBB = MO.getMBB();
313 if (!TargetMBB || TargetMBB != &
MBB)
320 bool HasOtherBranch =
false;
327 if (Instr.isDebugInstr() || Instr.isTransient())
333 if (Instr.isBranch() || Instr.isCall()) {
334 HasOtherBranch =
true;
351 "Fill delay slot for MIPS",
false,
false)
354static
void insertDelayFiller(Iter Filler,
const BB2BrMap &
BrMap) {
362 I.first->push_back(MF->CloneMachineInstr(&*Filler));
372 if (!MO.isReg() || !MO.isDef() || !(R = MO.getReg()))
378 "Shouldn't move an instruction with unallocatable registers across "
379 "basic block boundaries.");
382 if (!
MBB.isLiveIn(R))
392 update(
MI, 0,
MI.getDesc().getNumOperands());
402 update(
MI,
MI.getDesc().getNumOperands(),
MI.getNumOperands());
403 Defs.
reset(Mips::R1);
407void RegDefsUses::setCallerSaved(
const MachineInstr &
MI) {
420 BitVector CallerSavedRegs(
TRI.getNumRegs(),
true);
422 CallerSavedRegs.reset(Mips::R0);
423 CallerSavedRegs.reset(Mips::R0_64);
425 for (
const MCPhysReg *R =
TRI.getCalleeSavedRegs(
MI.getParent()->getParent());
427 for (MCRegAliasIterator AI(*R, &
TRI,
true); AI.isValid(); ++AI)
428 CallerSavedRegs.reset(*AI);
430 Defs |= CallerSavedRegs;
434 BitVector AllocSet =
TRI.getAllocatableSet(MF);
436 for (
unsigned R : AllocSet.
set_bits())
437 for (MCRegAliasIterator AI(R, &
TRI,
false); AI.isValid(); ++AI)
440 AllocSet.
set(Mips::R0);
441 AllocSet.
set(Mips::R0_64);
443 Defs |= AllocSet.
flip();
446void RegDefsUses::addLiveOut(
const MachineBasicBlock &
MBB,
447 const MachineBasicBlock &SuccBB) {
450 for (
const auto &LI : S->liveins())
454bool RegDefsUses::update(
const MachineInstr &
MI,
unsigned Begin,
unsigned End) {
455 BitVector NewDefs(
TRI.getNumRegs()), NewUses(
TRI.getNumRegs());
456 bool HasHazard =
false;
458 for (
unsigned I = Begin;
I !=
End; ++
I) {
459 const MachineOperand &MO =
MI.getOperand(
I);
462 if (checkRegDefsUses(NewDefs, NewUses, MO.
getReg(), MO.
isDef())) {
477bool RegDefsUses::checkRegDefsUses(BitVector &NewDefs, BitVector &NewUses,
478 unsigned Reg,
bool IsDef)
const {
482 return (isRegInSet(Defs,
Reg) || isRegInSet(
Uses,
Reg));
487 return isRegInSet(Defs,
Reg);
490bool RegDefsUses::isRegInSet(
const BitVector &RegSet,
unsigned Reg)
const {
492 for (MCRegAliasIterator AI(
Reg, &
TRI,
true); AI.isValid(); ++AI)
493 if (RegSet.
test(*AI))
498bool InspectMemInstr::hasHazard(
const MachineInstr &
MI) {
499 if (!
MI.mayStore() && !
MI.mayLoad())
505 OrigSeenLoad = SeenLoad;
506 OrigSeenStore = SeenStore;
507 SeenLoad |=
MI.mayLoad();
508 SeenStore |=
MI.mayStore();
512 if (
MI.hasOrderedMemoryRef() && (OrigSeenLoad || OrigSeenStore)) {
513 ForbidMemInstr =
true;
517 return hasHazard_(
MI);
520bool LoadFromStackOrConst::hasHazard_(
const MachineInstr &
MI) {
524 if (!
MI.hasOneMemOperand() || !(*
MI.memoperands_begin())->getPseudoValue())
527 if (
const PseudoSourceValue *PSV =
528 (*
MI.memoperands_begin())->getPseudoValue()) {
531 return !PSV->isConstant(
nullptr) && !PSV->isStack();
537MemDefsUses::MemDefsUses(
const MachineFrameInfo *MFI_)
538 : InspectMemInstr(
false), MFI(MFI_) {}
541 bool HasHazard =
false;
544 SmallVector<ValueType, 4> Objs;
547 HasHazard |= updateDefsUses(VT,
MI.mayStore());
552 HasHazard =
MI.mayStore() && (OrigSeenLoad || OrigSeenStore);
553 HasHazard |=
MI.mayLoad() || OrigSeenStore;
555 SeenNoObjLoad |=
MI.mayLoad();
556 SeenNoObjStore |=
MI.mayStore();
561bool MemDefsUses::updateDefsUses(
ValueType V,
bool MayStore) {
563 return !Defs.insert(
V).second ||
Uses.count(
V) || SeenNoObjStore ||
567 return Defs.count(
V) || SeenNoObjStore;
571getUnderlyingObjects(
const MachineInstr &
MI,
572 SmallVectorImpl<ValueType> &Objects)
const {
573 if (!
MI.hasOneMemOperand())
576 auto & MMO = **
MI.memoperands_begin();
578 if (
const PseudoSourceValue *PSV = MMO.getPseudoValue()) {
579 if (!PSV->isAliased(MFI))
585 if (
const Value *
V = MMO.getValue()) {
589 for (
const Value *UValue : Objs) {
607 unsigned NewOpcode =
TII->getEquivalentCompactForm(Branch);
608 Branch =
TII->genInstrWithNewOpc(NewOpcode, Branch);
612 if (ToErase->shouldUpdateAdditionalCallInfo())
613 ToErase->getMF()->moveAdditionalCallInfo(ToErase,
615 ToErase->eraseFromParent();
627 return Mips::BGEZALS_MM;
629 return Mips::BLTZALS_MM;
632 return Mips::JALS_MM;
634 return Mips::JALRS_MM;
635 case Mips::JALR16_MM:
636 return Mips::JALRS16_MM;
637 case Mips::TAILCALL_MM:
639 case Mips::TAILCALLREG:
640 return Mips::JR16_MM;
656 const BranchInformation &BranchInfo,
const MachineInstr &Candidate,
660 if (!BranchInfo.hasBranchInstr() || BranchInfo.isIndirectBranch())
664 if (!TargetMBB || TargetMBB->
empty())
667 bool Exposed = !IsSafe(TargetMBB->
instr_front(), Candidate);
671 if (!BranchInfo.isUnconditionalBranch()) {
672 if (!BranchInfo.hasBranchElseInstr())
674 Exposed |= !IsSafe(*BranchInfo.getBranchElseInstr(), Candidate);
685 const BranchInformation &BranchInfo,
686 RegDefsUses &RegDU, InspectMemInstr &IM) {
688 "KILL instructions should have been eliminated at this point.");
692 HasHazard |= IM.hasHazard(Candidate);
693 HasHazard |= RegDU.update(Candidate, 0, Candidate.
getNumOperands());
702 BranchInfo, Candidate,
704 return TII->SafeInLoadDelaySlot(InShadow, Cand);
711 BranchInfo, Candidate,
713 return TII->SafeInFPUDelaySlot(InShadow, Cand);
722template <
typename IterTy>
724 const BranchInformation &BranchInfo, RegDefsUses &RegDU,
725 InspectMemInstr &IM, Iter Slot, IterTy &Filler) {
726 for (IterTy
I = Begin;
I !=
End;) {
739 if (CurrI->isDebugInstr() || CurrI->isJumpTableDebugInfo() ||
740 CurrI->isMetaInstruction()) {
746 if (CurrI->isBundle()) {
750 RegDU.update(*CurrI, 0, CurrI->getNumOperands());
754 assert((!CurrI->isCall() && !CurrI->isReturn() && !CurrI->isBranch()) &&
755 "Cannot put calls, returns or branches in delay slot.");
757 if (CurrI->isKill()) {
758 CurrI->eraseFromParent();
768 unsigned Opcode = (*Slot).getOpcode();
780 if (InMicroMipsMode &&
TII->getInstSizeInBytes(*CurrI) == 2 &&
781 (Opcode == Mips::JR || Opcode == Mips::PseudoIndirectBranch ||
782 Opcode == Mips::PseudoIndirectBranch_MM ||
783 Opcode == Mips::PseudoReturn || Opcode == Mips::TAILCALL))
787 if (InMicroMipsMode && (Opcode == Mips::LWP_MM || Opcode == Mips::SWP_MM ||
788 Opcode == Mips::MOVEP_MM))
804 const BranchInformation &BranchInfo) {
805 const MipsOptions &CLOpts =
807 if (CLOpts.disable_mips_df_backward_search)
810 auto *Fn =
MBB.getParent();
811 RegDefsUses RegDU(*Fn->getSubtarget().getRegisterInfo());
812 MemDefsUses MemDU(&Fn->getFrameInfo());
819 MemDU, Slot, Filler)) {
821 "slot using backwards search.\n");
825 MBB.splice(std::next(SlotI), &
MBB, Filler.getReverse());
834 const BranchInformation &BranchInfo) {
835 const MipsOptions &CLOpts =
838 if (CLOpts.disable_mips_df_forward_search || !Slot->isCall())
841 RegDefsUses RegDU(*
MBB.getParent()->getSubtarget().getRegisterInfo());
845 RegDU.setCallerSaved(*Slot);
850 "slot using forwards search.\n");
854 MBB.splice(std::next(Slot), &
MBB, Filler);
862static MachineBasicBlock *
873 return Prob.getEdgeProbability(&B, Dst0) <
874 Prob.getEdgeProbability(&B, Dst1);
876 return S->
isEHPad() ? nullptr : S;
881static std::pair<MipsInstrInfo::BranchType, MachineInstr *>
890 TII->analyzeBranch(
MBB, TrueBB, FalseBB,
Cond,
false, BranchInstrs);
893 return std::make_pair(R,
nullptr);
901 return std::make_pair(R, BranchInstrs[0]);
904 assert((TrueBB == &Dst) || (FalseBB == &Dst));
920 RegDefsUses &RegDU,
bool &HasMultipleSuccs,
922 std::pair<MipsInstrInfo::BranchType, MachineInstr *>
P =
932 HasMultipleSuccs =
true;
933 RegDU.addLiveOut(
Pred, Succ);
945 const BranchInformation &BranchInfo,
947 const MipsOptions &CLOpts =
949 if (CLOpts.disable_mips_df_succbb_search)
957 RegDefsUses RegDU(*
MBB.getParent()->getSubtarget().getRegisterInfo());
958 bool HasMultipleSuccs =
false;
960 std::unique_ptr<InspectMemInstr> IM;
962 auto *Fn =
MBB.getParent();
971 RegDU.setUnallocatableRegs(*Fn);
975 if (HasMultipleSuccs) {
976 IM.reset(
new LoadFromStackOrConst());
979 IM.reset(
new MemDefsUses(&MFI));
986 insertDelayFiller(Filler,
BrMap);
988 Filler->eraseFromParent();
998 const MipsOptions &CLOpts =
1006 for (Iter
I =
MBB.begin();
I !=
MBB.end(); ++
I) {
1013 bool SkipForFixR5900 =
false;
1016 "short loop branch.\n");
1017 ++R5900ShortLoopNops;
1018 SkipForFixR5900 =
true;
1023 if (!CLOpts.disable_mips_delay_filler &&
1025 !(InMicroMipsMode && STI.
hasMips32r6()) && !SkipForFixR5900) {
1027 bool Filled =
false;
1028 const auto BranchInfo =
1029 BranchInformation(
I,
MBB.end(), FirstNextMBBInstr);
1032 !
TII->getEquivalentCompactForm(
I)) {
1035 " in backwards search.\n");
1037 }
else if (
I->isTerminator()) {
1041 " in successor BB search.\n");
1045 " in forwards search.\n");
1054 if (InMicroMipsMode &&
TII->getInstSizeInBytes(*std::next(DSI)) == 2 &&
1081 if ((InMicroMipsMode ||
1084 TII->getEquivalentCompactForm(
I)) {
1093 TII->insertNop(
MBB, std::next(
I),
I->getDebugLoc());
1104 return new MipsDelaySlotFillerLegacy();
1117 (
MBB != MF.
end() && !(*MBB).empty()) ? &(*MBB).instr_front() :
nullptr,
1130bool MipsDelaySlotFillerLegacy::runOnMachineFunction(
MachineFunction &MF) {
1132 MF, [&]() -> MachineBranchProbabilityInfo & {
1133 return getAnalysis<MachineBranchProbabilityInfoWrapperPass>().getMBPI();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Function Alias Analysis false
static const Function * getParent(const Value *V)
This file implements the BitVector class.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static unsigned InstrCount
This file defines the DenseMap class.
static bool hasHazard(StateT InitialState, function_ref< HazardFnResult(StateT &, const MachineInstr &)> IsHazard, function_ref< void(StateT &, const MachineInstr &)> UpdateState, const MachineBasicBlock *InitialMBB, MachineBasicBlock::const_reverse_instr_iterator InitialI)
const HexagonInstrInfo * TII
Register const TargetRegisterInfo * TRI
static bool hasUnoccupiedSlot(const MachineInstr *MI)
static bool runOnMachineBasicBlock(MachineBasicBlock &MBB, MachineInstr *FirstNextMBBInstr, function_ref< MachineBranchProbabilityInfo &()> GetMBPI)
runOnMachineBasicBlock - Fill in delay slots for the given basic block.
static void addLiveInRegs(Iter Filler, MachineBasicBlock &MBB)
This function adds registers Filler defines to MBB's live-in register list.
static bool isR5900ShortLoopBranch(const MachineInstr *MI, const MachineBasicBlock &MBB)
Check if a branch is a short backward loop that triggers the R5900 erratum.
static std::pair< MipsInstrInfo::BranchType, MachineInstr * > getBranch(MachineBasicBlock &MBB, const MachineBasicBlock &Dst)
This function analyzes MBB and returns an instruction with an unoccupied slot that branches to Dst.
static MachineBasicBlock * selectSuccBB(MachineBasicBlock &B, function_ref< MachineBranchProbabilityInfo &()> GetMBPI)
Pick a successor block of MBB.
static bool delayHasHazard(const MipsSubtarget &STI, const MachineInstr &Candidate, const BranchInformation &BranchInfo, RegDefsUses &RegDU, InspectMemInstr &IM)
This function checks if it is valid to move Candidate to the delay slot and returns true if it isn't.
static bool searchSuccBBs(MachineBasicBlock &MBB, Iter Slot, const BranchInformation &BranchInfo, function_ref< MachineBranchProbabilityInfo &()> GetMBPI)
This function searches one of MBB's successor blocks for an instruction that can be moved to the dela...
static bool runDelaySlotFillerOnFunction(MachineFunction &MF, function_ref< MachineBranchProbabilityInfo &()> GetMBPI)
static bool terminateSearch(const MachineInstr &Candidate)
static Iter replaceWithCompactBranch(MachineBasicBlock &MBB, Iter Branch, const DebugLoc &DL)
static bool searchRange(MachineBasicBlock &MBB, IterTy Begin, IterTy End, const BranchInformation &BranchInfo, RegDefsUses &RegDU, InspectMemInstr &IM, Iter Slot, IterTy &Filler)
This function searches range [Begin, End) for an instruction that can be moved to the delay slot.
static bool searchBackward(MachineBasicBlock &MBB, MachineInstr &Slot, const BranchInformation &BranchInfo)
This function searches in the backward direction for an instruction that can be moved to the delay sl...
static int getEquivalentCallShort(int Opcode)
static bool examinePred(MachineBasicBlock &Pred, const MachineBasicBlock &Succ, RegDefsUses &RegDU, bool &HasMultipleSuccs, BB2BrMap &BrMap)
Examine Pred and see if it is possible to insert an instruction into one of its branches delay slot o...
static bool delayExposesHazard(const BranchInformation &BranchInfo, const MachineInstr &Candidate, function_ref< bool(const MachineInstr &, const MachineInstr &)> IsSafe)
Returns true if putting the candidate in the delay slot could let the branch target,...
static bool searchForward(MachineBasicBlock &MBB, Iter Slot, const BranchInformation &BranchInfo)
This function searches MBB in the forward direction for an instruction that can be moved to the delay...
#define IsMFLOMFHI(instr)
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
This file defines the PointerUnion class, which is a discriminated union of pointer types.
static bool isBranch(unsigned Opcode)
SmallVector< MachineOperand, 4 > Cond
Remove Loads Into Fake Uses
This file defines the SmallPtrSet class.
This file defines the SmallVector class.
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
AnalysisUsage & addRequired()
LLVM_ABI void setPreservesCFG()
This function should be called by the pass, iff they do not:
bool test(unsigned Idx) const
Returns true if bit Idx is set.
BitVector & reset()
Reset all bits in the bitvector.
BitVector & set()
Set all bits in the bitvector.
BitVector & flip()
Flip all bits in the bitvector.
iterator_range< const_set_bits_iterator > set_bits() const
Represents analyses that only rely on functions' control flow.
FunctionPass class - This class is used to implement most global optimizations.
An RAII based helper class to modify MachineFunctionProperties when running pass.
Helper class for constructing bundles of MachineInstrs.
MIBundleBuilder & append(MachineInstr *MI)
Insert MI into MBB by appending it to the instructions in the bundle.
bool isEHPad() const
Returns true if the block is a landing pad.
Instructions::iterator instr_iterator
MachineInstrBundleIterator< MachineInstr, true > reverse_iterator
iterator_range< succ_iterator > successors()
iterator_range< pred_iterator > predecessors()
MachineInstrBundleIterator< MachineInstr > iterator
MachineInstr & instr_front()
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
reverse_iterator getReverse() const
Get a reverse iterator to the same node.
Representation of each machine instruction.
bool isTerminator(QueryType Type=AnyInBundle) const
Returns true if this instruction part of the terminator for a basic block.
bool isImplicitDef() const
bool isCall(QueryType Type=AnyInBundle) const
unsigned getNumOperands() const
Retuns the total number of operands.
LLVM_ABI bool hasUnmodeledSideEffects() const
Return true if this instruction has side effects that are not modeled by mayLoad / mayStore,...
bool isPseudo(QueryType Type=IgnoreBundle) const
Return true if this is a pseudo instruction that doesn't correspond to a real machine instruction.
MachineOperand class - Representation of each machine instruction operand.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
LLVM_ABI void dump() const
Register getReg() const
getReg - Returns the register number.
void invalidateLiveness()
invalidateLiveness - Indicates that register liveness is no longer being tracked accurately.
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
bool inMicroMipsMode() const
const MipsInstrInfo * getInstrInfo() const override
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
PreservedAnalyses & preserveSet()
Mark an analysis set as preserved.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Primary interface to the complete machine description for the target machine.
CodeGenOptLevel getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
BitVector getAllocatableSet(const MachineFunction &MF, const TargetRegisterClass *RC=nullptr) const
Returns a bitset indexed by register number indicating if a register is allocatable or not.
virtual const TargetRegisterInfo * getRegisterInfo() const =0
Return the target's register information.
An efficient, type-erasing, non-owning reference to a callable.
Pass manager infrastructure for declaring and invalidating analyses.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr MCPhysReg RA_64
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
@ Always
'always' may in some circumstances may not be absolutely adhered to, there may not be a corresponding...
@ Never
The policy 'never' may in some circumstances or for some ISAs not be absolutely adhered to.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
auto max_element(R &&Range)
Provide wrappers to std::max_element which take ranges instead of having to pass begin/end explicitly...
FunctionPass * createMipsDelaySlotFillerLegacyPass()
createMipsDelaySlotFillerPass - Returns a pass that fills in delay slots in Mips MachineFunctions
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
PointerUnion< const Value *, const PseudoSourceValue * > ValueType
@ End
Run the machine verifier once, at the end of the pipeline.
LLVM_ABI void getUnderlyingObjects(const Value *V, SmallVectorImpl< const Value * > &Objects, const LoopInfo *LI=nullptr, unsigned MaxLookup=MaxLookupSearchDepth)
This method is similar to getUnderlyingObject except that it can look through phi and select instruct...
LLVM_ABI bool isIdentifiedObject(const Value *V)
Return true if this pointer refers to a distinct and identifiable object.