Lines Matching refs:curBlk

491     BlockT *curBlk = *iterBlk;  in prepare()  local
492 removeUnconditionalBranch(curBlk); in prepare()
493 removeRedundantConditionalBranch(curBlk); in prepare()
494 if (CFGTraits::isReturnBlock(curBlk)) { in prepare()
495 retBlks.push_back(curBlk); in prepare()
497 assert(curBlk->succ_size() <= 2); in prepare()
565 BlockT *curBlk; in run() local
590 curBlk = *iterBlk; in run()
594 sccBeginBlk = curBlk; in run()
603 if (!isRetiredBlock(curBlk)) { in run()
604 patternMatch(curBlk); in run()
617 errs() << "Can't reduce SCC " << getSCCNum(curBlk) in run()
627 errs() << "repeat processing SCC" << getSCCNum(curBlk) in run()
752 template<class PassT> int CFGStructurizer<PassT>::patternMatch(BlockT *curBlk) { in patternMatch() argument
757 errs() << "Begin patternMatch BB" << curBlk->getNumber() << "\n"; in patternMatch()
760 while ((curMatch = patternMatchGroup(curBlk)) > 0) { in patternMatch()
765 errs() << "End patternMatch BB" << curBlk->getNumber() in patternMatch()
773 int CFGStructurizer<PassT>::patternMatchGroup(BlockT *curBlk) { in patternMatchGroup() argument
775 numMatch += serialPatternMatch(curBlk); in patternMatchGroup()
776 numMatch += ifPatternMatch(curBlk); in patternMatchGroup()
778 numMatch += loopendPatternMatch(curBlk); in patternMatchGroup()
779 numMatch += loopPatternMatch(curBlk); in patternMatchGroup()
784 int CFGStructurizer<PassT>::serialPatternMatch(BlockT *curBlk) { in serialPatternMatch() argument
785 if (curBlk->succ_size() != 1) { in serialPatternMatch()
789 BlockT *childBlk = *curBlk->succ_begin(); in serialPatternMatch()
794 mergeSerialBlock(curBlk, childBlk); in serialPatternMatch()
800 int CFGStructurizer<PassT>::ifPatternMatch(BlockT *curBlk) { in ifPatternMatch() argument
802 if (curBlk->succ_size() != 2) { in ifPatternMatch()
806 if (hasBackEdge(curBlk)) { in ifPatternMatch()
810 InstrT *branchInstr = CFGTraits::getNormalBlockBranchInstr(curBlk); in ifPatternMatch()
818 BlockT *falseBlk = CFGTraits::getFalseBranch(curBlk, branchInstr); in ifPatternMatch()
842 return handleJumpintoIf(curBlk, trueBlk, falseBlk); in ifPatternMatch()
851 cloned += improveSimpleJumpintoIf(curBlk, trueBlk, falseBlk, &landBlk); in ifPatternMatch()
855 trueBlk = cloneBlockForPredecessor(trueBlk, curBlk); in ifPatternMatch()
860 falseBlk = cloneBlockForPredecessor(falseBlk, curBlk); in ifPatternMatch()
864 mergeIfthenelseBlock(branchInstr, curBlk, trueBlk, falseBlk, landBlk); in ifPatternMatch()
874 int CFGStructurizer<PassT>::switchPatternMatch(BlockT *curBlk) { in switchPatternMatch() argument
879 int CFGStructurizer<PassT>::loopendPatternMatch(BlockT *curBlk) { in loopendPatternMatch() argument
880 LoopT *loopRep = loopInfo->getLoopFor(curBlk); in loopendPatternMatch()
919 int CFGStructurizer<PassT>::loopPatternMatch(BlockT *curBlk) { in loopPatternMatch() argument
920 if (curBlk->succ_size() != 0) { in loopPatternMatch()
925 LoopT *loopRep = loopInfo->getLoopFor(curBlk); in loopPatternMatch()
926 while (loopRep && loopRep->getHeader() == curBlk) { in loopPatternMatch()
932 mergeLooplandBlock(curBlk, loopLand); in loopPatternMatch()
1130 BlockT *curBlk = *iter; in loopcontPatternMatch() local
1131 if (loopRep->contains(curBlk)) { in loopcontPatternMatch()
1132 handleLoopcontBlock(curBlk, loopInfo->getLoopFor(curBlk), in loopcontPatternMatch()
1134 contBlk.push_back(curBlk); in loopcontPatternMatch()
1422 BlockT *curBlk = *predIter; in improveSimpleJumpintoIf() local
1423 if (curBlk != trueBlk && curBlk != falseBlk) { in improveSimpleJumpintoIf()
1424 CFGTraits::insertAssignInstrBefore(curBlk, passRep, initReg, 2); in improveSimpleJumpintoIf()
1520 BlockT *curBlk, in mergeIfthenelseBlock() argument
1525 errs() << "ifPattern BB" << curBlk->getNumber(); in mergeIfthenelseBlock()
1557 CFGTraits::getInstrPos(curBlk, branchInstr); in mergeIfthenelseBlock()
1564 curBlk->splice(branchInstrPos, trueBlk, FirstNonDebugInstr(trueBlk), trueBlk->end()); in mergeIfthenelseBlock()
1565 curBlk->removeSuccessor(trueBlk); in mergeIfthenelseBlock()
1569 retireBlock(curBlk, trueBlk); in mergeIfthenelseBlock()
1574 curBlk->splice(branchInstrPos, falseBlk, FirstNonDebugInstr(falseBlk), in mergeIfthenelseBlock()
1576 curBlk->removeSuccessor(falseBlk); in mergeIfthenelseBlock()
1580 retireBlock(curBlk, falseBlk); in mergeIfthenelseBlock()
1588 curBlk->addSuccessor(landBlk); in mergeIfthenelseBlock()
2083 CFGStructurizer<PassT>::cloneBlockForPredecessor(BlockT *curBlk, in cloneBlockForPredecessor() argument
2085 assert(predBlk->isSuccessor(curBlk) && in cloneBlockForPredecessor()
2088 BlockT *cloneBlk = CFGTraits::clone(curBlk); //clone instructions in cloneBlockForPredecessor()
2089 CFGTraits::replaceInstrUseOfBlockWith(predBlk, curBlk, cloneBlk); in cloneBlockForPredecessor()
2092 predBlk->removeSuccessor(curBlk); in cloneBlockForPredecessor()
2096 CFGTraits::cloneSuccessorList(cloneBlk, curBlk); in cloneBlockForPredecessor()
2098 numClonedInstr += curBlk->size(); in cloneBlockForPredecessor()
2102 << curBlk->getNumber() << "size " << curBlk->size() << "\n"; in cloneBlockForPredecessor()
2119 BlockT *curBlk = *iterSucc; in exitingBlock2ExitBlock() local
2120 if (!loopRep->contains(curBlk)) { in exitingBlock2ExitBlock()
2122 exitBlk = curBlk; in exitingBlock2ExitBlock()
2256 BlockT *curBlk = *iter; in addDummyExitBlock() local
2257 InstrT *curInstr = CFGTraits::getReturnInstr(curBlk); in addDummyExitBlock()
2262 if (curBlk->size()==0 && curBlk->pred_size() == 1) { in addDummyExitBlock()
2264 errs() << "Replace empty block BB" << curBlk->getNumber() in addDummyExitBlock()
2267 BlockT *predb = *curBlk->pred_begin(); in addDummyExitBlock()
2268 predb->removeSuccessor(curBlk); in addDummyExitBlock()
2269 curBlk = predb; in addDummyExitBlock()
2272 curBlk->addSuccessor(dummyExitBlk); in addDummyExitBlock()
2274 errs() << "Add dummyExitBlock to BB" << curBlk->getNumber() in addDummyExitBlock()
2332 bool CFGStructurizer<PassT>::isActiveLoophead(BlockT *curBlk) { in isActiveLoophead() argument
2333 LoopT *loopRep = loopInfo->getLoopFor(curBlk); in isActiveLoophead()
2334 while (loopRep && loopRep->getHeader() == curBlk) { in isActiveLoophead()
2377 BlockT *curBlk = *predIter; in recordLoopLandBlock() local
2378 if (loopRep->contains(curBlk) || exitBlkSet.count(curBlk)) { in recordLoopLandBlock()
2379 inpathBlks.push_back(curBlk); in recordLoopLandBlock()
2393 BlockT *curBlk = *iter; in recordLoopLandBlock() local
2394 CFGTraits::replaceInstrUseOfBlockWith(curBlk, landBlk, newLandBlk); in recordLoopLandBlock()
2396 curBlk->removeSuccessor(landBlk); in recordLoopLandBlock()
2397 curBlk->addSuccessor(newLandBlk); in recordLoopLandBlock()
2537 bool CFGStructurizer<PassT>::hasBackEdge(BlockT *curBlk) { in hasBackEdge() argument
2538 LoopT *loopRep = loopInfo->getLoopFor(curBlk); in hasBackEdge()
2544 return curBlk->isSuccessor(loopHeader); in hasBackEdge()
2616 BlockT *curBlk = *iter; in findNearestCommonPostDom() local
2617 if (curBlk != commonDom) { in findNearestCommonPostDom()
2618 commonDom = findNearestCommonPostDom(curBlk, commonDom); in findNearestCommonPostDom()