llvm.org GIT mirror llvm / 2d521e5
Rename new TailDuplicationPass to avoid name conflict with the old one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89968 91177308-0d34-0410-b5e6-96231b3b80d8 Bob Wilson 10 years ago
3 changed file(s) with 18 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
128128 /// branches.
129129 FunctionPass *createBranchFoldingPass(bool DefaultEnableTailMerge);
130130
131 /// TailDuplication Pass - Duplicate blocks with unconditional branches
131 /// TailDuplicate Pass - Duplicate blocks with unconditional branches
132132 /// into tails of their predecessors.
133 FunctionPass *createTailDuplicationPass();
133 FunctionPass *createTailDuplicatePass();
134134
135135 /// IfConverter Pass - This pass performs machine code if conversion.
136136 FunctionPass *createIfConverterPass();
347347
348348 // Tail duplication.
349349 if (OptLevel != CodeGenOpt::None && !DisableTailDuplicate) {
350 PM.add(createTailDuplicationPass());
351 printAndVerify(PM, "After TailDuplication");
350 PM.add(createTailDuplicatePass());
351 printAndVerify(PM, "After TailDuplicate");
352352 }
353353
354354 PM.add(createGCMachineCodeAnalysisPass());
3636 cl::init(2), cl::Hidden);
3737
3838 namespace {
39 /// TailDuplicationPass - Perform tail duplication.
40 class TailDuplicationPass : public MachineFunctionPass {
39 /// TailDuplicatePass - Perform tail duplication.
40 class TailDuplicatePass : public MachineFunctionPass {
4141 const TargetInstrInfo *TII;
4242 MachineModuleInfo *MMI;
4343
4444 public:
4545 static char ID;
46 explicit TailDuplicationPass() : MachineFunctionPass(&ID) {}
46 explicit TailDuplicatePass() : MachineFunctionPass(&ID) {}
4747
4848 virtual bool runOnMachineFunction(MachineFunction &MF);
4949 virtual const char *getPassName() const { return "Tail Duplication"; }
5454 void RemoveDeadBlock(MachineBasicBlock *MBB);
5555 };
5656
57 char TailDuplicationPass::ID = 0;
58 }
59
60 FunctionPass *llvm::createTailDuplicationPass() {
61 return new TailDuplicationPass();
62 }
63
64 bool TailDuplicationPass::runOnMachineFunction(MachineFunction &MF) {
57 char TailDuplicatePass::ID = 0;
58 }
59
60 FunctionPass *llvm::createTailDuplicatePass() {
61 return new TailDuplicatePass();
62 }
63
64 bool TailDuplicatePass::runOnMachineFunction(MachineFunction &MF) {
6565 TII = MF.getTarget().getInstrInfo();
6666 MMI = getAnalysisIfAvailable();
6767
7979 /// TailDuplicateBlocks - Look for small blocks that are unconditionally
8080 /// branched to and do not fall through. Tail-duplicate their instructions
8181 /// into their predecessors to eliminate (dynamic) branches.
82 bool TailDuplicationPass::TailDuplicateBlocks(MachineFunction &MF) {
82 bool TailDuplicatePass::TailDuplicateBlocks(MachineFunction &MF) {
8383 bool MadeChange = false;
8484
8585 for (MachineFunction::iterator I = ++MF.begin(), E = MF.end(); I != E; ) {
104104
105105 /// TailDuplicate - If it is profitable, duplicate TailBB's contents in each
106106 /// of its predecessors.
107 bool TailDuplicationPass::TailDuplicate(MachineBasicBlock *TailBB,
107 bool TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB,
108108 MachineFunction &MF) {
109109 // Don't try to tail-duplicate single-block loops.
110110 if (TailBB->isSuccessor(TailBB))
224224
225225 /// RemoveDeadBlock - Remove the specified dead machine basic block from the
226226 /// function, updating the CFG.
227 void TailDuplicationPass::RemoveDeadBlock(MachineBasicBlock *MBB) {
227 void TailDuplicatePass::RemoveDeadBlock(MachineBasicBlock *MBB) {
228228 assert(MBB->pred_empty() && "MBB must be dead!");
229229 DEBUG(errs() << "\nRemoving MBB: " << *MBB);
230230