Lines Matching refs:OrigHeader
88 static void RewriteUsesOfClonedInstructions(BasicBlock *OrigHeader,
92 BasicBlock::iterator I, E = OrigHeader->end();
93 for (I = OrigHeader->begin(); PHINode *PN = dyn_cast<PHINode>(I); ++I)
96 // Now fix up users of the instructions in OrigHeader, inserting PHI nodes
99 for (I = OrigHeader->begin(); I != E; ++I) {
112 SSA.AddAvailableValue(OrigHeader, OrigHeaderVal);
115 // Visit each use of the OrigHeader instruction.
130 // The original users in the OrigHeader are already using the
132 if (UserBB == OrigHeader)
155 BasicBlock *OrigHeader = L->getHeader();
157 BranchInst *BI = dyn_cast<BranchInst>(OrigHeader->getTerminator());
164 if (!L->isLoopExiting(OrigHeader))
179 Metrics.analyzeBasicBlock(OrigHeader);
215 // Begin by walking OrigHeader and populating ValueMap with an entry for
217 BasicBlock::iterator I = OrigHeader->begin(), E = OrigHeader->end();
268 // Along with all the other instructions, we just cloned OrigHeader's
269 // terminator into OrigPreHeader. Fix up the PHI nodes in each of OrigHeader's
270 // successors by duplicating their incoming values for OrigHeader.
271 TerminatorInst *TI = OrigHeader->getTerminator();
275 PN->addIncoming(PN->getIncomingValueForBlock(OrigHeader), OrigPreheader);
277 // Now that OrigPreHeader has a clone of OrigHeader's terminator, remove
279 // remove the corresponding incoming values from the PHI nodes in OrigHeader.
284 RewriteUsesOfClonedInstructions(OrigHeader, OrigPreheader, ValueMap);
312 // Update OrigHeader to be dominated by the new header block.
313 DT->changeImmediateDominator(OrigHeader, OrigLatch);
335 // Update OrigHeader to be dominated by the new header block.
337 DT->changeImmediateDominator(OrigHeader, OrigLatch);
345 // the OrigHeader block into OrigLatch. This will succeed if they are
348 MergeBlockIntoPredecessor(OrigHeader, this);