68 #define DEBUG_TYPE "ctrloops" 102 "PowerPC CTR Loops Verify",
false,
false)
108 return new PPCCTRLoopsVerify();
135 if (I == MBB->
begin()) {
148 unsigned Opc = I->getOpcode();
149 if (Opc == PPC::MTCTRloop || Opc == PPC::MTCTR8loop) {
156 <<
") instruction " << *I
157 <<
" clobbers CTR, invalidating " 159 << BI->getParent()->getFullName() <<
") instruction " 168 if (!CheckPreds && Preds.
empty())
176 << BI->getParent()->getFullName() <<
") instruction " 182 PIE = MBB->
pred_end(); PI != PIE; ++PI)
188 if (!Visited.
count(MBB)) {
192 }
while (!Preds.
empty());
198 MDT = &getAnalysis<MachineDominatorTree>();
205 if (!MDT->isReachableFromEntry(MBB))
209 MIIE = MBB->
end(); MII != MIIE; ++MII) {
210 unsigned Opc = MII->getOpcode();
211 if (Opc == PPC::BDNZ8 || Opc ==
PPC::BDNZ ||
212 Opc == PPC::BDZ8 || Opc ==
PPC::BDZ)
bool isRegMask() const
isRegMask - Tests if this is a MO_RegisterMask operand.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
This class represents lattice values for constants.
void initializePPCCTRLoopsVerifyPass(PassRegistry &)
void push_back(const T &Elt)
iterator getFirstTerminator()
Returns an iterator to the first terminator instruction of this basic block.
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
Printable printMBBReference(const MachineBasicBlock &MBB)
Prints a machine basic block reference.
unsigned getNumOperands() const
Retuns the total number of operands.
static cl::opt< int > CTRLoopLimit("ppc-max-ctrloop", cl::Hidden, cl::init(-1))
ppc ctr loops PowerPC CTR Loops Verify
CHAIN = BDNZ CHAIN, DESTBB - These are used to create counter-based loops.
FunctionPass * createPPCCTRLoopsVerify()
iterator getLastNonDebugInstr()
Returns an iterator to the last non-debug instruction in the basic block, or end().
initializer< Ty > init(const Ty &Val)
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
std::pair< NoneType, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
std::vector< MachineBasicBlock * >::iterator pred_iterator
pred_iterator pred_begin()
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
bool verify(const TargetRegisterInfo &TRI) const
Check that information hold by this instance make sense for the given TRI.
Iterator for intrusive lists based on ilist_node.
MachineOperand class - Representation of each machine instruction operand.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Module.h This file contains the declarations for the Module class.
LLVM_NODISCARD T pop_back_val()
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
static bool clobbersPhysReg(const uint32_t *RegMask, unsigned PhysReg)
clobbersPhysReg - Returns true if this RegMask clobbers PhysReg.
INITIALIZE_PASS_BEGIN(PPCCTRLoopsVerify, "ppc-ctr-loops-verify", "PowerPC CTR Loops Verify", false, false) INITIALIZE_PASS_END(PPCCTRLoopsVerify
Representation of each machine instruction.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
LLVM_NODISCARD bool empty() const
bool isReg() const
isReg - Tests if this is a MO_Register operand.
static bool clobbersCTR(const MachineInstr &MI)
std::string getFullName() const
Return a formatted string to identify this block and its parent function.
Register getReg() const
getReg - Returns the register number.
const MachineOperand & getOperand(unsigned i) const
static bool verifyCTRBranch(MachineBasicBlock *MBB, MachineBasicBlock::iterator I)
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
size_type count(const T &V) const
count - Return 1 if the element is in the set, 0 otherwise.