Lines Matching defs:PHI
109 /// Information about each phi in the Tail block.
111 MachineInstr *PHI;
116 PHIInfo(MachineInstr *phi)
117 : PHI(phi), TReg(0), FReg(0), CondCycles(0), TCycles(0), FCycles(0) {}
147 /// Replace PHI instructions in Tail with selects.
150 /// Insert selects and rewrite PHI operands to use them.
412 // Find PHI operands corresponding to TPred and FPred.
413 for (unsigned i = 1; i != PI.PHI->getNumOperands(); i += 2) {
414 if (PI.PHI->getOperand(i+1).getMBB() == TPred)
415 PI.TReg = PI.PHI->getOperand(i).getReg();
416 if (PI.PHI->getOperand(i+1).getMBB() == FPred)
417 PI.FReg = PI.PHI->getOperand(i).getReg();
419 assert(TargetRegisterInfo::isVirtualRegister(PI.TReg) && "Bad PHI");
420 assert(TargetRegisterInfo::isVirtualRegister(PI.FReg) && "Bad PHI");
425 DEBUG(dbgs() << "Can't convert: " << *PI.PHI);
450 /// replacePHIInstrs - Completely replace PHI instructions with selects.
462 DEBUG(dbgs() << "If-converting " << *PI.PHI);
463 unsigned DstReg = PI.PHI->getOperand(0).getReg();
466 PI.PHI->eraseFromParent();
467 PI.PHI
472 /// select instructions in Head and rewrite PHI operands to use the selects.
473 /// Keep the PHI instructions in Tail to handle the other predecessors.
484 DEBUG(dbgs() << "If-converting " << *PI.PHI);
490 unsigned PHIDst = PI.PHI->getOperand(0).getReg();
497 // Rewrite PHI operands TPred -> (DstReg, Head), remove FPred.
498 for (unsigned i = PI.PHI->getNumOperands(); i != 1; i -= 2) {
499 MachineBasicBlock *MBB = PI.PHI->getOperand(i-1).getMBB();
501 PI.PHI->getOperand(i-1).setMBB(Head);
502 PI.PHI->getOperand(i-2).setReg(DstReg);
504 PI.PHI->RemoveOperand(i-1);
505 PI.PHI->RemoveOperand(i-2);
508 DEBUG(dbgs() << " --> " << *PI.PHI);
729 unsigned Slack = TailTrace.getInstrSlack(PI.PHI);
730 unsigned MaxDepth = Slack + TailTrace.getInstrCycles(PI.PHI).Depth;
731 DEBUG(dbgs() << "Slack " << Slack << ":\t" << *PI.PHI);
745 unsigned TDepth = adjCycles(TBBTrace.getPHIDepth(PI.PHI), PI.TCycles);
756 unsigned FDepth = adjCycles(FBBTrace.getPHIDepth(PI.PHI), PI.FCycles);