Lines Matching defs:Header
387 MachineBasicBlock *Header = L->getHeader();
391 if (!Header || !Preheader || !Latch || !ExitingBlock)
407 for (instr_iterator I = Header->instr_begin(), E = Header->instr_end();
590 MachineBasicBlock *Header = L->getHeader();
592 // the header. Otherwise, branch to TB could be exiting the loop, and
593 // the fall through can go to the header.
602 TB = (LTB == Header) ? LTB : LFB;
604 FB = (LTB == Header) ? LTB: LFB;
606 assert ((!FB || TB == Header || FB == Header) && "Branches not to header?");
607 if (!TB || (FB && TB != Header && FB != Header))
612 // If TB is not the header, it means that the "not-taken" path must lead
613 // to the header.
614 bool Negated = TII->predOpcodeHasNot(Cond) ^ (TB != Header);
667 if (!MDT->properlyDominates(DefBB, Header))
674 if (!MDT->properlyDominates(DefBB, Header))
1090 assert(L->getHeader() && "Loop without a header?");
1570 MachineBasicBlock *Header = L->getHeader();
1574 if (!(Header && Latch && ExitingBlock))
1590 for (instr_iterator I = Header->instr_begin(), E = Header->instr_end();
1636 // unconditional branch to the loop header.
1638 TB = (LTB == Header) ? LTB : LFB;
1640 FB = (LTB == Header) ? LTB : LFB;
1642 if (TB != Header) {
1643 if (FB != Header) {
1644 // The latch/exit block does not go back to the header.
1647 // FB is the header (i.e., uncond. jump to branch header)
1819 MachineBasicBlock *Header = L->getHeader();
1822 MachineFunction *MF = Header->getParent();
1830 if (!Latch || !ExitingBlock || Header->hasAddressTaken())
1838 MBBVector Preds(Header->pred_begin(), Header->pred_end());
1853 MF->insert(Header->getIterator(), NewPH);
1855 if (Header->pred_size() > 2) {
1856 // Ensure that the header has only two predecessors: the preheader and
1857 // the loop latch. Any additional predecessors of the header should
1859 // header and create appropriate corresponding PHI nodes in the preheader.
1861 for (instr_iterator I = Header->instr_begin(), E = Header->instr_end();
1874 // Copy all non-latch operands of a header's PHI node to the newly
1903 assert(Header->pred_size() == 2);
1905 // The header has only two predecessors, but the non-latch predecessor
1908 // all we need is to adjust existing PHIs in the header to now refer to
1910 for (instr_iterator I = Header->instr_begin(), E = Header->instr_end();
1922 // If any of the predecessors falls through to the header, insert a branch
1936 if (TB != Header && (Tmp2.empty() || FB != Header))
1938 PB->ReplaceUsesOfBlockWith(Header, NewPH);
1942 // It can happen that the latch block will fall through into the header.
1943 // Insert an unconditional branch to the header.
1949 TII->InsertBranch(*Latch, Header, nullptr, EmptyCond, DL);
1951 // Finally, the branch from the preheader to the header.
1952 TII->InsertBranch(*NewPH, Header, nullptr, EmptyCond, DL);
1953 NewPH->addSuccessor(Header);
1961 MachineDomTreeNode *HDom = MDT->getNode(Header);
1963 MDT->changeImmediateDominator(Header, NewPH);