35 I.
getName()+
".reg2mem", AllocaPoint);
45 if (
InvokeInst *II = dyn_cast<InvokeInst>(&I)) {
46 if (!II->getNormalDest()->getSinglePredecessor()) {
48 assert(
isCriticalEdge(II, SuccNum) &&
"Expected a critical edge!");
50 assert(BB &&
"Unable to split critical edge.");
58 if (
PHINode *PN = dyn_cast<PHINode>(U)) {
69 for (
unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
70 if (PN->getIncomingValue(i) == &
I) {
71 Value *&V = Loads[PN->getIncomingBlock(i)];
75 PN->getIncomingBlock(i)->getTerminator());
77 PN->setIncomingValue(i, V);
91 if (!isa<TerminatorInst>(I)) {
94 for (; isa<PHINode>(InsertPt) || isa<LandingPadInst>(InsertPt); ++InsertPt)
118 P->
getName()+
".reg2mem", AllocaPoint);
129 "Invoke edge not supported yet"); (void)II;
138 for (; isa<PHINode>(InsertPt) || isa<LandingPadInst>(InsertPt); ++InsertPt)
iplist< Instruction >::iterator eraseFromParent()
eraseFromParent - This method unlinks 'this' from the containing basic block and deletes it...
AllocaInst * DemoteRegToStack(Instruction &X, bool VolatileLoads=false, Instruction *AllocaPoint=nullptr)
DemoteRegToStack - This function takes a virtual register computed by an Instruction and replaces it ...
const Function * getParent() const
Return the enclosing method, or null if none.
unsigned GetSuccessorNumber(BasicBlock *BB, BasicBlock *Succ)
Search for the specified successor of basic block BB and return its position in the terminator instru...
LoadInst - an instruction for reading from memory.
StringRef getName() const
Return a constant reference to the value's name.
iterator begin()
Instruction iterator methods.
load Combine Adjacent Loads
StoreInst - an instruction for storing to memory.
void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
BasicBlock * getNormalDest() const
unsigned getNumIncomingValues() const
getNumIncomingValues - Return the number of incoming edges
void replaceUsesOfWith(Value *From, Value *To)
Replace uses of one Value with another.
BasicBlock * SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, const CriticalEdgeSplittingOptions &Options=CriticalEdgeSplittingOptions())
SplitCriticalEdge - If this edge is a critical edge, insert a new node to split the critical edge...
LLVM Basic Block Representation.
BasicBlock * getIncomingBlock(unsigned i) const
getIncomingBlock - Return incoming basic block number i.
Value * getIncomingValue(unsigned i) const
getIncomingValue - Return incoming value number x
Type * getType() const
All values are typed, get the type of this value.
Instruction * user_back()
user_back - Specialize the methods defined in Value, as we know that an instruction can only be used ...
const BasicBlock & getEntryBlock() const
TerminatorInst * getTerminator()
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
AllocaInst * DemotePHIToStack(PHINode *P, Instruction *AllocaPoint=nullptr)
DemotePHIToStack - This function takes a virtual register computed by a phi node and replaces it with...
LLVM Value Representation.
InvokeInst - Invoke instruction.
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
AllocaInst - an instruction to allocate memory on the stack.
bool isCriticalEdge(const TerminatorInst *TI, unsigned SuccNum, bool AllowIdenticalEdges=false)
Return true if the specified edge is a critical edge.