blob: 7ed0c77e952b1d03a49274b8d6183c3cc048863a [file] [log] [blame]
David Goodwin2e7be612009-10-26 16:59:04 +00001//=- llvm/CodeGen/AntiDepBreaker.h - Anti-Dependence Breaking -*- C++ -*-=//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file implements the AntiDepBreaker class, which implements
11// anti-dependence breaking heuristics for post-register-allocation scheduling.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_CODEGEN_ANTIDEPBREAKER_H
16#define LLVM_CODEGEN_ANTIDEPBREAKER_H
17
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"
24
25namespace llvm {
26
27/// AntiDepBreaker - This class works into conjunction with the
28/// post-RA scheduler to rename registers to break register
29/// anti-dependencies.
30class AntiDepBreaker {
31public:
David Goodwinc9322132009-10-26 19:00:47 +000032 virtual ~AntiDepBreaker() { };
33
David Goodwin2e7be612009-10-26 16:59:04 +000034 /// Start - Initialize anti-dep breaking for a new basic block.
35 virtual void StartBlock(MachineBasicBlock *BB) =0;
36
37 /// BreakAntiDependencies - Identifiy anti-dependencies within a
38 /// basic-block region and break them by renaming registers. Return
39 /// the number of anti-dependencies broken.
40 ///
41 virtual unsigned BreakAntiDependencies(std::vector<SUnit>& SUnits,
42 MachineBasicBlock::iterator& Begin,
43 MachineBasicBlock::iterator& End,
44 unsigned InsertPosIndex) =0;
45
46 /// Observe - Update liveness information to account for the current
47 /// instruction, which will not be scheduled.
48 ///
49 virtual void Observe(MachineInstr *MI, unsigned Count,
50 unsigned InsertPosIndex) =0;
51
52 /// Finish - Finish anti-dep breaking for a basic block.
53 virtual void FinishBlock() =0;
54};
55
56}
57
58#endif