1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

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

This commit is contained in:
Sam Parker 2020-01-28 13:06:07 +00:00
parent cad5b9a068
commit 7e91753023
2 changed files with 8 additions and 6 deletions

View File

@ -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.

View File

@ -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.