Lines Matching refs:blk

2353 bool CFGStructurizer<PassT>::needMigrateBlock(BlockT *blk) {
2357 bool multiplePreds = blk && (blk->pred_size() > 1);
2362 unsigned blkSize = blk->size();
2364 && (blkSize * (blk->pred_size() - 1) > cloneInstrThreshold));
2413 void CFGStructurizer<PassT>::setLoopLandBlock(LoopT *loopRep, BlockT *blk) {
2421 if (blk == NULL) {
2422 blk = funcRep->CreateMachineBasicBlock();
2423 funcRep->push_back(blk); //insert to function
2424 SHOWNEWBLK(blk, "DummyLandingBlock for loop without break: ");
2427 theEntry->landBlk = blk;
2432 << " landing-block = BB" << blk->getNumber() << "\n";
2862 static void setTrueBranch(MachineInstr *instr, MachineBasicBlock *blk) {
2863 instr->getOperand(0).setMBB(blk);
2867 getFalseBranch(MachineBasicBlock *blk, MachineInstr *instr) {
2868 assert(blk->succ_size() == 2);
2870 MachineBasicBlock::succ_iterator iter = blk->succ_begin();
2901 static DebugLoc getLastDebugLocInBB(MachineBasicBlock *blk) {
2904 for (MachineBasicBlock::iterator iter = blk->begin(); iter != blk->end(); ++iter) {
2913 static MachineInstr *getNormalBlockBranchInstr(MachineBasicBlock *blk) {
2914 MachineBasicBlock::reverse_iterator iter = blk->rbegin();
2927 static MachineInstr *getLoopendBlockBranchInstr(MachineBasicBlock *blk) {
2929 blk->getParent()->getTarget().getInstrInfo());
2931 for (MachineBasicBlock::reverse_iterator iter = blk->rbegin(),
2932 iterEnd = blk->rend(); iter != iterEnd; ++iter) {
2946 static MachineInstr *getReturnInstr(MachineBasicBlock *blk) {
2947 MachineBasicBlock::reverse_iterator iter = blk->rbegin();
2948 if (iter != blk->rend()) {
2957 static MachineInstr *getContinueInstr(MachineBasicBlock *blk) {
2958 MachineBasicBlock::reverse_iterator iter = blk->rbegin();
2959 if (iter != blk->rend()) {
2968 static MachineInstr *getLoopBreakInstr(MachineBasicBlock *blk) {
2969 for (MachineBasicBlock::iterator iter = blk->begin(); (iter != blk->end()); ++iter) {
2978 static bool isReturnBlock(MachineBasicBlock *blk) {
2979 MachineInstr *instr = getReturnInstr(blk);
2980 bool isReturn = (blk->succ_size() == 0);
2985 errs() << "BB" << blk->getNumber()
2994 getInstrPos(MachineBasicBlock *blk, MachineInstr *instr) {
2995 assert(instr->getParent() == blk && "instruction doesn't belong to block");
2996 MachineBasicBlock::iterator iter = blk->begin();
2997 MachineBasicBlock::iterator iterEnd = blk->end();
3006 static MachineInstr *insertInstrBefore(MachineBasicBlock *blk, int newOpcode,
3008 return insertInstrBefore(blk,newOpcode,passRep,DebugLoc());
3011 static MachineInstr *insertInstrBefore(MachineBasicBlock *blk, int newOpcode,
3015 blk->getParent()->CreateMachineInstr(tii->get(newOpcode), DL);
3018 if (blk->begin() != blk->end()) {
3019 blk->insert(blk->begin(), newInstr);
3021 blk->push_back(newInstr);
3029 static void insertInstrEnd(MachineBasicBlock *blk, int newOpcode,
3031 insertInstrEnd(blk,newOpcode,passRep,DebugLoc());
3034 static void insertInstrEnd(MachineBasicBlock *blk, int newOpcode,
3037 MachineInstr *newInstr = blk->getParent()
3040 blk->push_back(newInstr);
3051 MachineBasicBlock *blk = oldInstr->getParent();
3053 blk->getParent()->CreateMachineInstr(tii->get(newOpcode),
3056 blk->insert(instrPos, newInstr);
3069 MachineBasicBlock *blk = oldInstr->getParent();
3071 blk->getParent()->CreateMachineInstr(tii->get(newOpcode),
3074 blk->insert(instrPos, newInstr);
3082 static void insertCondBranchBefore(MachineBasicBlock *blk,
3091 blk->getParent()->CreateMachineInstr(tii->get(newOpcode), DL);
3094 blk->insert(insertPos, newInstr);
3100 static void insertCondBranchEnd(MachineBasicBlock *blk,
3106 blk->getParent()->CreateMachineInstr(tii->get(newOpcode), DebugLoc());
3108 blk->push_back(newInstr);
3121 MachineBasicBlock *blk = oldInstr->getParent();
3122 MachineInstr *newInstr = tii->getMovImmInstr(blk->getParent(), regNum,
3124 blk->insert(instrPos, newInstr);
3129 static void insertAssignInstrBefore(MachineBasicBlock *blk,
3135 MachineInstr *newInstr = tii->getMovImmInstr(blk->getParent(), regNum,
3137 if (blk->begin() != blk->end()) {
3138 blk->insert(blk->begin(), newInstr);
3140 blk->push_back(newInstr);
3147 static void insertCompareInstrBefore(MachineBasicBlock *blk,
3155 blk->getParent()->CreateMachineInstr(tii->get(tii->getIEQOpcode()), DebugLoc());
3161 blk->insert(instrPos, newInstr);