• Home
  • Raw
  • Download

Lines Matching refs:BB

135   BasicBlock *getDiamondTail(BasicBlock *BB);
136 bool isDiamondHead(BasicBlock *BB);
141 LoadInst *canHoistFromBlock(BasicBlock *BB, LoadInst *LI);
142 void hoistInstruction(BasicBlock *BB, Instruction *HoistCand,
145 bool hoistLoad(BasicBlock *BB, LoadInst *HoistCand, LoadInst *ElseInst);
146 bool mergeLoads(BasicBlock *BB);
148 StoreInst *canSinkFromBlock(BasicBlock *BB, StoreInst *SI);
149 PHINode *getPHIOperand(BasicBlock *BB, StoreInst *S0, StoreInst *S1);
152 bool sinkStore(BasicBlock *BB, StoreInst *SinkCand, StoreInst *ElseInst);
153 bool mergeStores(BasicBlock *BB);
199 BasicBlock *MergedLoadStoreMotion::getDiamondTail(BasicBlock *BB) { in getDiamondTail() argument
200 assert(isDiamondHead(BB) && "Basic block is not head of a diamond"); in getDiamondTail()
201 BranchInst *BI = (BranchInst *)(BB->getTerminator()); in getDiamondTail()
210 bool MergedLoadStoreMotion::isDiamondHead(BasicBlock *BB) { in isDiamondHead() argument
211 if (!BB) in isDiamondHead()
213 if (!isa<BranchInst>(BB->getTerminator())) in isDiamondHead()
215 if (BB->getTerminator()->getNumSuccessors() != 2) in isDiamondHead()
218 BranchInst *BI = (BranchInst *)(BB->getTerminator()); in isDiamondHead()
288 void MergedLoadStoreMotion::hoistInstruction(BasicBlock *BB, in hoistInstruction() argument
291 DEBUG(dbgs() << " Hoist Instruction into BB \n"; BB->dump(); in hoistInstruction()
295 assert(HoistCand->getParent() != BB); in hoistInstruction()
302 Instruction *HoistPt = BB->getTerminator(); in hoistInstruction()
333 bool MergedLoadStoreMotion::hoistLoad(BasicBlock *BB, LoadInst *L0, in hoistLoad() argument
342 DEBUG(dbgs() << "Hoist Instruction into BB \n"; BB->dump(); in hoistLoad()
345 hoistInstruction(BB, A0, A1); in hoistLoad()
346 hoistInstruction(BB, L0, L1); in hoistLoad()
358 bool MergedLoadStoreMotion::mergeLoads(BasicBlock *BB) { in mergeLoads() argument
360 assert(isDiamondHead(BB)); in mergeLoads()
361 BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator()); in mergeLoads()
381 bool Res = hoistLoad(BB, L0, L1); in mergeLoads()
439 PHINode *MergedLoadStoreMotion::getPHIOperand(BasicBlock *BB, StoreInst *S0, in getPHIOperand() argument
447 &BB->front()); in getPHIOperand()
461 bool MergedLoadStoreMotion::sinkStore(BasicBlock *BB, StoreInst *S0, in sinkStore() argument
469 DEBUG(dbgs() << "Sink Instruction into BB \n"; BB->dump(); in sinkStore()
473 BasicBlock::iterator InsertPt = BB->getFirstInsertionPt(); in sinkStore()
487 PHINode *NewPN = getPHIOperand(BB, S0, S1); in sinkStore()
577 BasicBlock *BB = &*FI++; in runOnFunction() local
581 if (isDiamondHead(BB)) { in runOnFunction()
582 Changed |= mergeLoads(BB); in runOnFunction()
583 Changed |= mergeStores(getDiamondTail(BB)); in runOnFunction()