1 //=- llvm/CodeGen/AntiDepBreaker.h - Anti-Dependence Breaking -*- C++ -*-=//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements the AntiDepBreaker class, which implements
11 // anti-dependence breaking heuristics for post-register-allocation scheduling.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CODEGEN_ANTIDEPBREAKER_H
16 #define LLVM_CODEGEN_ANTIDEPBREAKER_H
18 #include "llvm/CodeGen/MachineBasicBlock.h"
19 #include "llvm/CodeGen/MachineFrameInfo.h"
20 #include "llvm/CodeGen/MachineFunction.h"
21 #include "llvm/CodeGen/MachineRegisterInfo.h"
22 #include "llvm/CodeGen/ScheduleDAG.h"
23 #include "llvm/Target/TargetRegisterInfo.h"
27 /// AntiDepBreaker - This class works into conjunction with the
28 /// post-RA scheduler to rename registers to break register
29 /// anti-dependencies.
30 class AntiDepBreaker {
32 virtual ~AntiDepBreaker();
34 /// GetMaxTrials - Return the maximum number of anti-dependence
35 /// breaking attempts that will be made for a block.
36 virtual unsigned GetMaxTrials() =0;
38 /// Start - Initialize anti-dep breaking for a new basic block.
39 virtual void StartBlock(MachineBasicBlock *BB) =0;
41 /// BreakAntiDependencies - Identifiy anti-dependencies within a
42 /// basic-block region and break them by renaming registers. Return
43 /// the number of anti-dependencies broken.
45 virtual unsigned BreakAntiDependencies(std::vector<SUnit>& SUnits,
46 MachineBasicBlock::iterator& Begin,
47 MachineBasicBlock::iterator& End,
48 unsigned InsertPosIndex) =0;
50 /// Observe - Update liveness information to account for the current
51 /// instruction, which will not be scheduled.
53 virtual void Observe(MachineInstr *MI, unsigned Count,
54 unsigned InsertPosIndex) =0;
56 /// Finish - Finish anti-dep breaking for a basic block.
57 virtual void FinishBlock() =0;