Commit 7ad879ca authored by Sam Parker's avatar Sam Parker
Browse files

[NFC][RDA] typedef SmallPtrSetImpl<MachineInstr*>

parent aec62103
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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

@@ -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.
+3 −3
Original line number Diff line number Diff line
@@ -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()) {
@@ -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;
@@ -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.