Go to the documentation of this file.
47 #define DEBUG_TYPE "ppc-ctrloops-verify"
74 "PowerPC CTR Loops Verify",
false,
false)
80 return new PPCCTRLoopsVerify();
86 if (MO.isDef() && (MO.getReg() == PPC::CTR || MO.getReg() == PPC::CTR8))
88 }
else if (MO.isRegMask()) {
89 if (MO.clobbersPhysReg(PPC::CTR) || MO.clobbersPhysReg(PPC::CTR8))
117 unsigned Opc =
I->getOpcode();
118 if (Opc == PPC::MTCTRloop || Opc == PPC::MTCTR8loop) {
125 <<
") instruction " << *
I
126 <<
" clobbers CTR, invalidating "
128 << BI->getParent()->getFullName() <<
") instruction "
137 if (!CheckPreds && Preds.empty())
145 << BI->getParent()->getFullName() <<
") instruction "
159 }
while (!Preds.empty());
165 MDT = &getAnalysis<MachineDominatorTree>();
170 if (!MDT->isReachableFromEntry(&
MBB))
174 MIIE =
MBB.
end(); MII != MIIE; ++MII) {
175 unsigned Opc = MII->getOpcode();
176 if (Opc == PPC::BDNZ8 || Opc ==
PPC::BDNZ ||
177 Opc == PPC::BDZ8 || Opc ==
PPC::BDZ)
This is an optimization pass for GlobalISel generic memory operations.
@ BDNZ
CHAIN = BDNZ CHAIN, DESTBB - These are used to create counter-based loops.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Printable printMBBReference(const MachineBasicBlock &MBB)
Prints a machine basic block reference.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
LLVM_NODISCARD T pop_back_val()
FunctionPass * createPPCCTRLoopsVerify()
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
ppc ctr loops PowerPC CTR Loops Verify
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
static bool verifyCTRBranch(MachineBasicBlock *MBB, MachineBasicBlock::iterator I)
Represent the analysis usage information of a pass.
MachineOperand class - Representation of each machine instruction operand.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
size_type count(const T &V) const
count - Return 1 if the element is in the set, 0 otherwise.
Representation of each machine instruction.
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
iterator getLastNonDebugInstr(bool SkipPseudoOp=true)
Returns an iterator to the last non-debug instruction in the basic block, or end().
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
static bool clobbersCTR(const MachineInstr &MI)
iterator_range< pred_iterator > predecessors()
void initializePPCCTRLoopsVerifyPass(PassRegistry &)
iterator getFirstTerminator()
Returns an iterator to the first terminator instruction of this basic block.
std::string getFullName() const
Return a formatted string to identify this block and its parent function.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void append_range(Container &C, Range &&R)
Wrapper function to append a range to a container.
std::pair< NoneType, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
Iterator for intrusive lists based on ilist_node.
INITIALIZE_PASS_BEGIN(PPCCTRLoopsVerify, "ppc-ctr-loops-verify", "PowerPC CTR Loops Verify", false, false) INITIALIZE_PASS_END(PPCCTRLoopsVerify
Unrolling by would eliminate the &in both leading to a net reduction in code size The resultant code would then also be suitable for exit value computation We miss a bunch of rotate opportunities on various including ppc
FunctionPass class - This class is used to implement most global optimizations.
AnalysisUsage & addRequired()
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...