• Home
  • Raw
  • Download

Lines Matching refs:PhysReg

32 static bool isValidRegUseOf(const MachineOperand &MO, MCRegister PhysReg) {  in isValidRegUseOf()  argument
33 return isValidRegUse(MO) && MO.getReg() == PhysReg; in isValidRegUseOf()
40 static bool isValidRegDefOf(const MachineOperand &MO, MCRegister PhysReg) { in isValidRegDefOf() argument
41 return isValidRegDef(MO) && MO.getReg() == PhysReg; in isValidRegDefOf()
61 for (MCRegUnitIterator Unit(LI.PhysReg, TRI); Unit.isValid(); ++Unit) { in enterBasicBlock()
257 MCRegister PhysReg) const { in getReachingDef()
265 for (MCRegUnitIterator Unit(PhysReg, TRI); Unit.isValid(); ++Unit) { in getReachingDef()
278 MCRegister PhysReg) const { in getReachingLocalMIDef()
279 return hasLocalDefBefore(MI, PhysReg) in getReachingLocalMIDef()
280 ? getInstFromId(MI->getParent(), getReachingDef(MI, PhysReg)) in getReachingLocalMIDef()
285 MCRegister PhysReg) const { in hasSameReachingDef()
291 return getReachingDef(A, PhysReg) == getReachingDef(B, PhysReg); in hasSameReachingDef()
314 MCRegister PhysReg) const { in getClearance()
316 return InstIds.lookup(MI) - getReachingDef(MI, PhysReg); in getClearance()
320 MCRegister PhysReg) const { in hasLocalDefBefore()
321 return getReachingDef(MI, PhysReg) >= 0; in hasLocalDefBefore()
325 MCRegister PhysReg, in getReachingLocalUses() argument
335 if (getReachingLocalMIDef(&*MI, PhysReg) != Def) in getReachingLocalUses()
339 if (!isValidRegUseOf(MO, PhysReg)) in getReachingLocalUses()
350 MCRegister PhysReg, in getLiveInUses() argument
355 if (!isValidRegUseOf(MO, PhysReg)) in getLiveInUses()
357 if (getReachingDef(&MI, PhysReg) >= 0) in getLiveInUses()
365 return isReachingDefLiveOut(&*Last, PhysReg); in getLiveInUses()
368 void ReachingDefAnalysis::getGlobalUses(MachineInstr *MI, MCRegister PhysReg, in getGlobalUses() argument
373 getReachingLocalUses(MI, PhysReg, Uses); in getGlobalUses()
376 if (auto *LiveOut = getLocalLiveOutMIDef(MI->getParent(), PhysReg)) { in getGlobalUses()
387 if (Visited.count(MBB) || !MBB->isLiveIn(PhysReg)) in getGlobalUses()
389 if (getLiveInUses(MBB, PhysReg, Uses)) in getGlobalUses()
398 MCRegister PhysReg, in getGlobalReachingDefs() argument
400 if (auto *Def = getUniqueReachingMIDef(MI, PhysReg)) { in getGlobalReachingDefs()
406 getLiveOuts(MBB, PhysReg, Defs); in getGlobalReachingDefs()
410 MCRegister PhysReg, InstSet &Defs) const { in getLiveOuts() argument
412 getLiveOuts(MBB, PhysReg, Defs, VisitedBBs); in getLiveOuts()
416 MCRegister PhysReg, InstSet &Defs, in getLiveOuts() argument
424 if (!LiveRegs.contains(PhysReg)) in getLiveOuts()
427 if (auto *Def = getLocalLiveOutMIDef(MBB, PhysReg)) in getLiveOuts()
431 getLiveOuts(Pred, PhysReg, Defs, VisitedBBs); in getLiveOuts()
436 MCRegister PhysReg) const { in getUniqueReachingMIDef()
438 MachineInstr *LocalDef = getReachingLocalMIDef(MI, PhysReg); in getUniqueReachingMIDef()
445 getLiveOuts(Pred, PhysReg, Incoming); in getUniqueReachingMIDef()
468 MCRegister PhysReg) const { in isRegUsedAfter()
474 if (LiveRegs.contains(PhysReg)) in isRegUsedAfter()
482 if (LiveRegs.contains(PhysReg)) in isRegUsedAfter()
489 MCRegister PhysReg) const { in isRegDefinedAfter()
493 getReachingDef(MI, PhysReg) != getReachingDef(&*Last, PhysReg)) in isRegDefinedAfter()
496 if (auto *Def = getLocalLiveOutMIDef(MBB, PhysReg)) in isRegDefinedAfter()
497 return Def == getReachingLocalMIDef(MI, PhysReg); in isRegDefinedAfter()
503 MCRegister PhysReg) const { in isReachingDefLiveOut()
507 if (!LiveRegs.contains(PhysReg)) in isReachingDefLiveOut()
511 int Def = getReachingDef(MI, PhysReg); in isReachingDefLiveOut()
512 if (Last != MBB->end() && getReachingDef(&*Last, PhysReg) != Def) in isReachingDefLiveOut()
517 if (isValidRegDefOf(MO, PhysReg)) in isReachingDefLiveOut()
525 MCRegister PhysReg) const { in getLocalLiveOutMIDef()
528 if (!LiveRegs.contains(PhysReg)) in getLocalLiveOutMIDef()
535 int Def = getReachingDef(&*Last, PhysReg); in getLocalLiveOutMIDef()
537 if (isValidRegDefOf(MO, PhysReg)) in getLocalLiveOutMIDef()
649 auto IsDead = [this, &Dead](MachineInstr *Def, MCRegister PhysReg) { in collectKilledOperands() argument
665 getGlobalUses(Def, PhysReg, Uses); in collectKilledOperands()
682 MCRegister PhysReg) const { in isSafeToDefRegAt()
684 return isSafeToDefRegAt(MI, PhysReg, Ignore); in isSafeToDefRegAt()
687 bool ReachingDefAnalysis::isSafeToDefRegAt(MachineInstr *MI, MCRegister PhysReg, in isSafeToDefRegAt() argument
690 if (isRegUsedAfter(MI, PhysReg)) { in isSafeToDefRegAt()
691 if (auto *Def = getReachingLocalMIDef(MI, PhysReg)) { in isSafeToDefRegAt()
693 getGlobalUses(Def, PhysReg, Uses); in isSafeToDefRegAt()
703 if (isRegDefinedAfter(MI, PhysReg)) { in isSafeToDefRegAt()
709 if (isValidRegDefOf(MO, PhysReg)) in isSafeToDefRegAt()