OpenASIP  2.0
TCERegisterInfo.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file TCERegisterInfo.h
26  *
27  * Declaration of TCERegisterInfo class.
28  *
29  * @author Veli-Pekka Jääskeläinen 2007 (vjaaskel-no.spam-cs.tut.fi)
30  * @author Heikki Kultala 2011 (heikki.kultala-no.spam-tut.fi)
31  */
32 
33 #ifndef TCE_REGISTER_INFO_H
34 #define TCE_REGISTER_INFO_H
35 
36 #include <llvm/ADT/BitVector.h>
37 
38 #include "TCESubtarget.hh"
39 
40 #define GET_REGINFO_HEADER
41 #include "TCEGenRegisterInfo.inc"
42 
43 #include "tce_config.h"
44 
45 namespace llvm {
46  class TargetInstrInfo;
47  class Type;
48  class TCEFrameLowering;
49 
50  /**
51  * Class which handles registers in the TCE backend.
52  */
53  class TCERegisterInfo : public TCEGenRegisterInfo {
54  public:
55  TCERegisterInfo(const TargetInstrInfo& tii);
56  virtual ~TCERegisterInfo() {};
57 
59  MachineFunction &MF,
60  MachineBasicBlock &MBB,
61  MachineBasicBlock::iterator I) const;
62 
63  const MCPhysReg* getCalleeSavedRegs(const MachineFunction *MF = 0) const override;
64 
65  BitVector getReservedRegs(const MachineFunction &MF) const override;
66 
67  void eliminateFrameIndex(MachineBasicBlock::iterator II,
68  int SPAdj, unsigned FIOperandNum,
69  RegScavenger *RS = NULL) const override;
70 
71  unsigned getRARegister() const;
72 
73  Register getFrameRegister(const MachineFunction& mf) const override;
74 
75  bool requiresRegisterScavenging(const MachineFunction&) const override;
76 
77  int getDwarfRegNum(unsigned regNum, bool isEH) const;
78  int getLLVMRegNum(unsigned int, bool) const;
79  bool hasFP(const MachineFunction &MF) const;
80  void setTFI(const TCEFrameLowering* tfi) { tfi_ = tfi; };
81  private:
82  void setReservedVectorRegs(llvm::BitVector& reserved) const;
83 
84  const TargetInstrInfo& tii_;
86  };
87 }
88 
89 
90 #endif
llvm::TCERegisterInfo::setTFI
void setTFI(const TCEFrameLowering *tfi)
Definition: TCERegisterInfo.hh:80
llvm
Definition: InlineAsmParser.hh:49
llvm::TCEFrameLowering
Definition: TCEFrameInfo.hh:60
llvm::TCERegisterInfo::requiresRegisterScavenging
bool requiresRegisterScavenging(const MachineFunction &) const override
Definition: TCERegisterInfo.cc:418
BitVector
Definition: BitVector.hh:44
llvm::TCERegisterInfo::TCERegisterInfo
TCERegisterInfo(const TargetInstrInfo &tii)
Definition: TCERegisterInfo.cc:82
llvm::TCERegisterInfo::getLLVMRegNum
int getLLVMRegNum(unsigned int, bool) const
llvm::TCERegisterInfo::~TCERegisterInfo
virtual ~TCERegisterInfo()
Definition: TCERegisterInfo.hh:56
llvm::TCERegisterInfo::getFrameRegister
Register getFrameRegister(const MachineFunction &mf) const override
Definition: TCERegisterInfo.cc:404
llvm::TCERegisterInfo::getCalleeSavedRegs
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF=0) const override
Definition: TCERegisterInfo.cc:92
llvm::TCERegisterInfo::hasFP
bool hasFP(const MachineFunction &MF) const
Definition: TCERegisterInfo.cc:413
llvm::TCERegisterInfo::eliminateCallFramePseudoInstr
void eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const
llvm::TCERegisterInfo::getReservedRegs
BitVector getReservedRegs(const MachineFunction &MF) const override
Definition: TCERegisterInfo.cc:105
llvm::TCERegisterInfo::getDwarfRegNum
int getDwarfRegNum(unsigned regNum, bool isEH) const
llvm::TCERegisterInfo::setReservedVectorRegs
void setReservedVectorRegs(llvm::BitVector &reserved) const
llvm::TCERegisterInfo::tii_
const TargetInstrInfo & tii_
Definition: TCERegisterInfo.hh:84
llvm::TCERegisterInfo::getRARegister
unsigned getRARegister() const
Definition: TCERegisterInfo.cc:398
TCESubtarget.hh
llvm::TCERegisterInfo
Definition: TCERegisterInfo.hh:53
llvm::TCERegisterInfo::eliminateFrameIndex
void eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=NULL) const override
Definition: TCERegisterInfo.cc:129
llvm::TCERegisterInfo::tfi_
const TCEFrameLowering * tfi_
Definition: TCERegisterInfo.hh:85