~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/lib/CodeGen/CriticalAntiDepBreaker.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-03-12 11:30:04 UTC
  • mfrom: (0.41.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100312113004-b0fop4bkycszdd0z
Tags: 0.96~rc1+dfsg-0ubuntu1
* New upstream RC - FFE (LP: #537636):
  - Add OfficialDatabaseOnly option to clamav-base.postinst.in
  - Add LocalSocketGroup option to clamav-base.postinst.in
  - Add LocalSocketMode option to clamav-base.postinst.in
  - Add CrossFilesystems option to clamav-base.postinst.in
  - Add ClamukoScannerCount option to clamav-base.postinst.in
  - Add BytecodeSecurity opiton to clamav-base.postinst.in
  - Add DetectionStatsHostID option to clamav-freshclam.postinst.in
  - Add Bytecode option to clamav-freshclam.postinst.in
  - Add MilterSocketGroup option to clamav-milter.postinst.in
  - Add MilterSocketMode option to clamav-milter.postinst.in
  - Add ReportHostname option to clamav-milter.postinst.in
  - Bump libclamav SO version to 6.1.0 in libclamav6.install
  - Drop clamdmon from clamav.examples (no longer shipped by upstream)
  - Drop libclamav.a from libclamav-dev.install (not built by upstream)
  - Update SO version for lintian override for libclamav6
  - Add new Bytecode Testing Tool, usr/bin/clambc, to clamav.install
  - Add build-depends on python and python-setuptools for new test suite
  - Update debian/copyright for the embedded copy of llvm (using the system
    llvm is not currently feasible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//=- llvm/CodeGen/CriticalAntiDepBreaker.h - Anti-Dep Support -*- 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 CriticalAntiDepBreaker class, which
 
11
// implements register anti-dependence breaking along a blocks
 
12
// critical path during post-RA scheduler.
 
13
//
 
14
//===----------------------------------------------------------------------===//
 
15
 
 
16
#ifndef LLVM_CODEGEN_CRITICALANTIDEPBREAKER_H
 
17
#define LLVM_CODEGEN_CRITICALANTIDEPBREAKER_H
 
18
 
 
19
#include "AntiDepBreaker.h"
 
20
#include "llvm/CodeGen/MachineBasicBlock.h"
 
21
#include "llvm/CodeGen/MachineFrameInfo.h"
 
22
#include "llvm/CodeGen/MachineFunction.h"
 
23
#include "llvm/CodeGen/MachineRegisterInfo.h"
 
24
#include "llvm/CodeGen/ScheduleDAG.h"
 
25
#include "llvm/Target/TargetRegisterInfo.h"
 
26
#include "llvm/ADT/BitVector.h"
 
27
#include "llvm/ADT/SmallSet.h"
 
28
#include <map>
 
29
 
 
30
namespace llvm {
 
31
  class CriticalAntiDepBreaker : public AntiDepBreaker {
 
32
    MachineFunction& MF;
 
33
    MachineRegisterInfo &MRI;
 
34
    const TargetRegisterInfo *TRI;
 
35
 
 
36
    /// AllocatableSet - The set of allocatable registers.
 
37
    /// We'll be ignoring anti-dependencies on non-allocatable registers,
 
38
    /// because they may not be safe to break.
 
39
    const BitVector AllocatableSet;
 
40
 
 
41
    /// Classes - For live regs that are only used in one register class in a
 
42
    /// live range, the register class. If the register is not live, the
 
43
    /// corresponding value is null. If the register is live but used in
 
44
    /// multiple register classes, the corresponding value is -1 casted to a
 
45
    /// pointer.
 
46
    const TargetRegisterClass *
 
47
      Classes[TargetRegisterInfo::FirstVirtualRegister];
 
48
 
 
49
    /// RegRegs - Map registers to all their references within a live range.
 
50
    std::multimap<unsigned, MachineOperand *> RegRefs;
 
51
 
 
52
    /// KillIndices - The index of the most recent kill (proceding bottom-up),
 
53
    /// or ~0u if the register is not live.
 
54
    unsigned KillIndices[TargetRegisterInfo::FirstVirtualRegister];
 
55
 
 
56
    /// DefIndices - The index of the most recent complete def (proceding bottom
 
57
    /// up), or ~0u if the register is live.
 
58
    unsigned DefIndices[TargetRegisterInfo::FirstVirtualRegister];
 
59
 
 
60
    /// KeepRegs - A set of registers which are live and cannot be changed to
 
61
    /// break anti-dependencies.
 
62
    SmallSet<unsigned, 4> KeepRegs;
 
63
 
 
64
  public:
 
65
    CriticalAntiDepBreaker(MachineFunction& MFi);
 
66
    ~CriticalAntiDepBreaker();
 
67
 
 
68
    /// Start - Initialize anti-dep breaking for a new basic block.
 
69
    void StartBlock(MachineBasicBlock *BB);
 
70
 
 
71
    /// BreakAntiDependencies - Identifiy anti-dependencies along the critical
 
72
    /// path
 
73
    /// of the ScheduleDAG and break them by renaming registers.
 
74
    ///
 
75
    unsigned BreakAntiDependencies(std::vector<SUnit>& SUnits,
 
76
                                   MachineBasicBlock::iterator& Begin,
 
77
                                   MachineBasicBlock::iterator& End,
 
78
                                   unsigned InsertPosIndex);
 
79
 
 
80
    /// Observe - Update liveness information to account for the current
 
81
    /// instruction, which will not be scheduled.
 
82
    ///
 
83
    void Observe(MachineInstr *MI, unsigned Count, unsigned InsertPosIndex);
 
84
 
 
85
    /// Finish - Finish anti-dep breaking for a basic block.
 
86
    void FinishBlock();
 
87
 
 
88
  private:
 
89
    void PrescanInstruction(MachineInstr *MI);
 
90
    void ScanInstruction(MachineInstr *MI, unsigned Count);
 
91
    unsigned findSuitableFreeRegister(MachineInstr *MI,
 
92
                                      unsigned AntiDepReg,
 
93
                                      unsigned LastNewReg,
 
94
                                      const TargetRegisterClass *);
 
95
  };
 
96
}
 
97
 
 
98
#endif