35 I.
getName()+
".reg2mem", AllocaPoint);
45 if (
PHINode *PN = dyn_cast<PHINode>(U)) {
56 for (
unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
57 if (PN->getIncomingValue(i) == &
I) {
58 Value *&V = Loads[PN->getIncomingBlock(i)];
62 PN->getIncomingBlock(i)->getTerminator());
64 PN->setIncomingValue(i, V);
79 if (!isa<TerminatorInst>(I)) {
93 "Expected a critical edge!");
95 assert (BB &&
"Unable to split critical edge.");
100 for (; isa<PHINode>(InsertPt) || isa<LandingPadInst>(InsertPt); ++InsertPt)
120 P->
getName()+
".reg2mem", AllocaPoint);
131 "Invoke edge not supported yet"); (void)II;
140 for (; isa<PHINode>(InsertPt) || isa<LandingPadInst>(InsertPt); ++InsertPt)
BasicBlock * SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P=0, bool MergeIdenticalEdges=false, bool DontDeleteUselessPHIs=false, bool SplitLandingPads=false)
AllocaInst * DemoteRegToStack(Instruction &X, bool VolatileLoads=false, Instruction *AllocaPoint=0)
const Function * getParent() const
Return the enclosing method, or null if none.
unsigned GetSuccessorNumber(BasicBlock *BB, BasicBlock *Succ)
StringRef getName() const
void replaceAllUsesWith(Value *V)
BasicBlock * getNormalDest() const
unsigned getNumIncomingValues() const
void replaceUsesOfWith(Value *From, Value *To)
LLVM Basic Block Representation.
BasicBlock * getIncomingBlock(unsigned i) const
AllocaInst * DemotePHIToStack(PHINode *P, Instruction *AllocaPoint=0)
Value * getIncomingValue(unsigned i) const
const BasicBlock & getEntryBlock() const
BasicBlock * getSinglePredecessor()
Return this block if it has a single predecessor block. Otherwise return a null pointer.
TerminatorInst * getTerminator()
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
LLVM Value Representation.
iterator getFirstInsertionPt()
Returns an iterator to the first instruction in this block that is suitable for inserting a non-PHI i...
const BasicBlock * getParent() const
bool isCriticalEdge(const TerminatorInst *TI, unsigned SuccNum, bool AllowIdenticalEdges=false)