Loading llvm/include/llvm/CodeGen/ReachingDefAnalysis.h +5 −3 Original line number Diff line number Diff line Loading @@ -70,6 +70,8 @@ private: /// Default values are 'nothing happened a long time ago'. const int ReachingDefDefaultVal = -(1 << 20); using InstSet = SmallPtrSetImpl<MachineInstr*>; public: static char ID; // Pass identification, replacement for typeid Loading Loading @@ -126,18 +128,18 @@ public: /// Provides the uses, in the same block as MI, of register that MI defines. /// This does not consider live-outs. void getReachingLocalUses(MachineInstr *MI, int PhysReg, SmallPtrSetImpl<MachineInstr*> &Uses) const; InstSet &Uses) const; /// For the given block, collect the instructions that use the live-in /// value of the provided register. Return whether the value is still /// live on exit. bool getLiveInUses(MachineBasicBlock *MBB, int PhysReg, SmallPtrSetImpl<MachineInstr*> &Uses) const; InstSet &Uses) const; /// Collect the users of the value stored in PhysReg, which is defined /// by MI. void getGlobalUses(MachineInstr *MI, int PhysReg, SmallPtrSetImpl<MachineInstr*> &Uses) const; InstSet &Uses) const; private: /// Set up LiveRegs by merging predecessor live-out values. Loading llvm/lib/CodeGen/ReachingDefAnalysis.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -227,7 +227,7 @@ ReachingDefAnalysis::getClearance(MachineInstr *MI, MCPhysReg PhysReg) const { } void ReachingDefAnalysis::getReachingLocalUses(MachineInstr *Def, int PhysReg, SmallPtrSetImpl<MachineInstr*> &Uses) const { InstSet &Uses) const { MachineBasicBlock *MBB = Def->getParent(); MachineBasicBlock::iterator MI = MachineBasicBlock::iterator(Def); while (++MI != MBB->end()) { Loading @@ -252,7 +252,7 @@ void ReachingDefAnalysis::getReachingLocalUses(MachineInstr *Def, int PhysReg, bool ReachingDefAnalysis::getLiveInUses(MachineBasicBlock *MBB, int PhysReg, SmallPtrSetImpl<MachineInstr*> &Uses) const { InstSet &Uses) const { for (auto &MI : *MBB) { if (MI.isDebugInstr()) continue; Loading @@ -269,7 +269,7 @@ ReachingDefAnalysis::getLiveInUses(MachineBasicBlock *MBB, int PhysReg, void ReachingDefAnalysis::getGlobalUses(MachineInstr *MI, int PhysReg, SmallPtrSetImpl<MachineInstr*> &Uses) const { InstSet &Uses) const { MachineBasicBlock *MBB = MI->getParent(); // Collect the uses that each def touches within the block. Loading Loading
llvm/include/llvm/CodeGen/ReachingDefAnalysis.h +5 −3 Original line number Diff line number Diff line Loading @@ -70,6 +70,8 @@ private: /// Default values are 'nothing happened a long time ago'. const int ReachingDefDefaultVal = -(1 << 20); using InstSet = SmallPtrSetImpl<MachineInstr*>; public: static char ID; // Pass identification, replacement for typeid Loading Loading @@ -126,18 +128,18 @@ public: /// Provides the uses, in the same block as MI, of register that MI defines. /// This does not consider live-outs. void getReachingLocalUses(MachineInstr *MI, int PhysReg, SmallPtrSetImpl<MachineInstr*> &Uses) const; InstSet &Uses) const; /// For the given block, collect the instructions that use the live-in /// value of the provided register. Return whether the value is still /// live on exit. bool getLiveInUses(MachineBasicBlock *MBB, int PhysReg, SmallPtrSetImpl<MachineInstr*> &Uses) const; InstSet &Uses) const; /// Collect the users of the value stored in PhysReg, which is defined /// by MI. void getGlobalUses(MachineInstr *MI, int PhysReg, SmallPtrSetImpl<MachineInstr*> &Uses) const; InstSet &Uses) const; private: /// Set up LiveRegs by merging predecessor live-out values. Loading
llvm/lib/CodeGen/ReachingDefAnalysis.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -227,7 +227,7 @@ ReachingDefAnalysis::getClearance(MachineInstr *MI, MCPhysReg PhysReg) const { } void ReachingDefAnalysis::getReachingLocalUses(MachineInstr *Def, int PhysReg, SmallPtrSetImpl<MachineInstr*> &Uses) const { InstSet &Uses) const { MachineBasicBlock *MBB = Def->getParent(); MachineBasicBlock::iterator MI = MachineBasicBlock::iterator(Def); while (++MI != MBB->end()) { Loading @@ -252,7 +252,7 @@ void ReachingDefAnalysis::getReachingLocalUses(MachineInstr *Def, int PhysReg, bool ReachingDefAnalysis::getLiveInUses(MachineBasicBlock *MBB, int PhysReg, SmallPtrSetImpl<MachineInstr*> &Uses) const { InstSet &Uses) const { for (auto &MI : *MBB) { if (MI.isDebugInstr()) continue; Loading @@ -269,7 +269,7 @@ ReachingDefAnalysis::getLiveInUses(MachineBasicBlock *MBB, int PhysReg, void ReachingDefAnalysis::getGlobalUses(MachineInstr *MI, int PhysReg, SmallPtrSetImpl<MachineInstr*> &Uses) const { InstSet &Uses) const { MachineBasicBlock *MBB = MI->getParent(); // Collect the uses that each def touches within the block. Loading