35 I.
getName()+
".reg2mem", AllocaPoint);
45 if (
InvokeInst *II = dyn_cast<InvokeInst>(&I)) {
46 if (!II->getNormalDest()->getSinglePredecessor()) {
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)) {
93 for (; isa<PHINode>(InsertPt) || InsertPt->isEHPad(); ++InsertPt)
117 P->
getName()+
".reg2mem", AllocaPoint);
128 "Invoke edge not supported yet"); (void)II;
137 for (; isa<PHINode>(InsertPt) || InsertPt->isEHPad(); ++InsertPt)
SymbolTableList< Instruction >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
AllocaInst * DemoteRegToStack(Instruction &X, bool VolatileLoads=false, Instruction *AllocaPoint=nullptr)
This function takes a virtual register computed by an Instruction and replaces it with a slot in the ...
const Function * getParent() const
Return the enclosing method, or null if none.
const Instruction & front() const
An instruction for reading from memory.
StringRef getName() const
Return a constant reference to the value's name.
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
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())
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
Return incoming basic block number i.
self_iterator getIterator()
Iterator for intrusive lists based on ilist_node.
Value * getIncomingValue(unsigned i) const
Return incoming value number x.
Type * getType() const
All values are typed, get the type of this value.
Instruction * user_back()
Specialize the methods defined in Value, as we know that an instruction can only be used by other ins...
const BasicBlock & getEntryBlock() const
unsigned GetSuccessorNumber(const BasicBlock *BB, const BasicBlock *Succ)
Search for the specified successor of basic block BB and return its position in the terminator instru...
TerminatorInst * getTerminator()
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
AllocaInst * DemotePHIToStack(PHINode *P, Instruction *AllocaPoint=nullptr)
This function takes a virtual register computed by a phi node and replaces it with a slot in the stac...
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
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.