mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-14 15:39:00 +00:00
remove function names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244509 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8843f88076
commit
ac7345f4c1
@ -59,7 +59,7 @@ TailDupLimit("tail-dup-limit", cl::init(~0U), cl::Hidden);
|
|||||||
typedef std::vector<std::pair<MachineBasicBlock*,unsigned> > AvailableValsTy;
|
typedef std::vector<std::pair<MachineBasicBlock*,unsigned> > AvailableValsTy;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
/// TailDuplicatePass - Perform tail duplication.
|
/// Perform tail duplication.
|
||||||
class TailDuplicatePass : public MachineFunctionPass {
|
class TailDuplicatePass : public MachineFunctionPass {
|
||||||
const TargetInstrInfo *TII;
|
const TargetInstrInfo *TII;
|
||||||
const TargetRegisterInfo *TRI;
|
const TargetRegisterInfo *TRI;
|
||||||
@ -69,11 +69,11 @@ namespace {
|
|||||||
std::unique_ptr<RegScavenger> RS;
|
std::unique_ptr<RegScavenger> RS;
|
||||||
bool PreRegAlloc;
|
bool PreRegAlloc;
|
||||||
|
|
||||||
// SSAUpdateVRs - A list of virtual registers for which to update SSA form.
|
// A list of virtual registers for which to update SSA form.
|
||||||
SmallVector<unsigned, 16> SSAUpdateVRs;
|
SmallVector<unsigned, 16> SSAUpdateVRs;
|
||||||
|
|
||||||
// SSAUpdateVals - For each virtual register in SSAUpdateVals keep a list of
|
// For each virtual register in SSAUpdateVals keep a list of source virtual
|
||||||
// source virtual registers.
|
// registers.
|
||||||
DenseMap<unsigned, AvailableValsTy> SSAUpdateVals;
|
DenseMap<unsigned, AvailableValsTy> SSAUpdateVals;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -207,7 +207,7 @@ static void VerifyPHIs(MachineFunction &MF, bool CheckExtra) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// TailDuplicateAndUpdate - Tail duplicate the block and cleanup.
|
/// Tail duplicate the block and cleanup.
|
||||||
bool
|
bool
|
||||||
TailDuplicatePass::TailDuplicateAndUpdate(MachineBasicBlock *MBB,
|
TailDuplicatePass::TailDuplicateAndUpdate(MachineBasicBlock *MBB,
|
||||||
bool IsSimple,
|
bool IsSimple,
|
||||||
@ -310,9 +310,9 @@ TailDuplicatePass::TailDuplicateAndUpdate(MachineBasicBlock *MBB,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// TailDuplicateBlocks - Look for small blocks that are unconditionally
|
/// Look for small blocks that are unconditionally branched to and do not fall
|
||||||
/// branched to and do not fall through. Tail-duplicate their instructions
|
/// through. Tail-duplicate their instructions into their predecessors to
|
||||||
/// into their predecessors to eliminate (dynamic) branches.
|
/// eliminate (dynamic) branches.
|
||||||
bool TailDuplicatePass::TailDuplicateBlocks(MachineFunction &MF) {
|
bool TailDuplicatePass::TailDuplicateBlocks(MachineFunction &MF) {
|
||||||
bool MadeChange = false;
|
bool MadeChange = false;
|
||||||
|
|
||||||
@ -375,8 +375,7 @@ static void getRegsUsedByPHIs(const MachineBasicBlock &BB,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// AddSSAUpdateEntry - Add a definition and source virtual registers pair for
|
/// Add a definition and source virtual registers pair for SSA update.
|
||||||
/// SSA update.
|
|
||||||
void TailDuplicatePass::AddSSAUpdateEntry(unsigned OrigReg, unsigned NewReg,
|
void TailDuplicatePass::AddSSAUpdateEntry(unsigned OrigReg, unsigned NewReg,
|
||||||
MachineBasicBlock *BB) {
|
MachineBasicBlock *BB) {
|
||||||
DenseMap<unsigned, AvailableValsTy>::iterator LI= SSAUpdateVals.find(OrigReg);
|
DenseMap<unsigned, AvailableValsTy>::iterator LI= SSAUpdateVals.find(OrigReg);
|
||||||
@ -390,9 +389,8 @@ void TailDuplicatePass::AddSSAUpdateEntry(unsigned OrigReg, unsigned NewReg,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ProcessPHI - Process PHI node in TailBB by turning it into a copy in PredBB.
|
/// Process PHI node in TailBB by turning it into a copy in PredBB. Remember the
|
||||||
/// Remember the source register that's contributed by PredBB and update SSA
|
/// source register that's contributed by PredBB and update SSA update map.
|
||||||
/// update map.
|
|
||||||
void TailDuplicatePass::ProcessPHI(
|
void TailDuplicatePass::ProcessPHI(
|
||||||
MachineInstr *MI, MachineBasicBlock *TailBB, MachineBasicBlock *PredBB,
|
MachineInstr *MI, MachineBasicBlock *TailBB, MachineBasicBlock *PredBB,
|
||||||
DenseMap<unsigned, unsigned> &LocalVRMap,
|
DenseMap<unsigned, unsigned> &LocalVRMap,
|
||||||
@ -422,7 +420,7 @@ void TailDuplicatePass::ProcessPHI(
|
|||||||
MI->eraseFromParent();
|
MI->eraseFromParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// DuplicateInstruction - Duplicate a TailBB instruction to PredBB and update
|
/// Duplicate a TailBB instruction to PredBB and update
|
||||||
/// the source operands due to earlier PHI translation.
|
/// the source operands due to earlier PHI translation.
|
||||||
void TailDuplicatePass::DuplicateInstruction(MachineInstr *MI,
|
void TailDuplicatePass::DuplicateInstruction(MachineInstr *MI,
|
||||||
MachineBasicBlock *TailBB,
|
MachineBasicBlock *TailBB,
|
||||||
@ -459,9 +457,9 @@ void TailDuplicatePass::DuplicateInstruction(MachineInstr *MI,
|
|||||||
PredBB->insert(PredBB->instr_end(), NewMI);
|
PredBB->insert(PredBB->instr_end(), NewMI);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// UpdateSuccessorsPHIs - After FromBB is tail duplicated into its predecessor
|
/// After FromBB is tail duplicated into its predecessor blocks, the successors
|
||||||
/// blocks, the successors have gained new predecessors. Update the PHI
|
/// have gained new predecessors. Update the PHI instructions in them
|
||||||
/// instructions in them accordingly.
|
/// accordingly.
|
||||||
void
|
void
|
||||||
TailDuplicatePass::UpdateSuccessorsPHIs(MachineBasicBlock *FromBB, bool isDead,
|
TailDuplicatePass::UpdateSuccessorsPHIs(MachineBasicBlock *FromBB, bool isDead,
|
||||||
SmallVectorImpl<MachineBasicBlock *> &TDBBs,
|
SmallVectorImpl<MachineBasicBlock *> &TDBBs,
|
||||||
@ -545,7 +543,7 @@ TailDuplicatePass::UpdateSuccessorsPHIs(MachineBasicBlock *FromBB, bool isDead,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// shouldTailDuplicate - Determine if it is profitable to duplicate this block.
|
/// Determine if it is profitable to duplicate this block.
|
||||||
bool
|
bool
|
||||||
TailDuplicatePass::shouldTailDuplicate(const MachineFunction &MF,
|
TailDuplicatePass::shouldTailDuplicate(const MachineFunction &MF,
|
||||||
bool IsSimple,
|
bool IsSimple,
|
||||||
@ -621,7 +619,7 @@ TailDuplicatePass::shouldTailDuplicate(const MachineFunction &MF,
|
|||||||
return canCompletelyDuplicateBB(TailBB);
|
return canCompletelyDuplicateBB(TailBB);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// isSimpleBB - True if this BB has only one unconditional jump.
|
/// True if this BB has only one unconditional jump.
|
||||||
bool
|
bool
|
||||||
TailDuplicatePass::isSimpleBB(MachineBasicBlock *TailBB) {
|
TailDuplicatePass::isSimpleBB(MachineBasicBlock *TailBB) {
|
||||||
if (TailBB->succ_size() != 1)
|
if (TailBB->succ_size() != 1)
|
||||||
@ -744,7 +742,7 @@ TailDuplicatePass::duplicateSimpleBB(MachineBasicBlock *TailBB,
|
|||||||
return Changed;
|
return Changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// TailDuplicate - If it is profitable, duplicate TailBB's contents in each
|
/// If it is profitable, duplicate TailBB's contents in each
|
||||||
/// of its predecessors.
|
/// of its predecessors.
|
||||||
bool
|
bool
|
||||||
TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB,
|
TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB,
|
||||||
@ -961,8 +959,8 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB,
|
|||||||
return Changed;
|
return Changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// RemoveDeadBlock - Remove the specified dead machine basic block from the
|
/// Remove the specified dead machine basic block from the function, updating
|
||||||
/// function, updating the CFG.
|
/// the CFG.
|
||||||
void TailDuplicatePass::RemoveDeadBlock(MachineBasicBlock *MBB) {
|
void TailDuplicatePass::RemoveDeadBlock(MachineBasicBlock *MBB) {
|
||||||
assert(MBB->pred_empty() && "MBB must be dead!");
|
assert(MBB->pred_empty() && "MBB must be dead!");
|
||||||
DEBUG(dbgs() << "\nRemoving MBB: " << *MBB);
|
DEBUG(dbgs() << "\nRemoving MBB: " << *MBB);
|
||||||
|
Loading…
Reference in New Issue
Block a user