summaryrefslogtreecommitdiff
path: root/include/llvm/Target
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2003-07-29 19:41:23 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2003-07-29 19:41:23 +0000
commitceb7d2f4f8bb220990b9392f4dcf1eff7fd5690c (patch)
tree272f370d7020d205803e0950b5a8b41e7d3c12c9 /include/llvm/Target
parentb403b2c0193aa2226069faa1208676d3f6380bde (diff)
downloadllvm-ceb7d2f4f8bb220990b9392f4dcf1eff7fd5690c.tar.gz
llvm-ceb7d2f4f8bb220990b9392f4dcf1eff7fd5690c.tar.bz2
llvm-ceb7d2f4f8bb220990b9392f4dcf1eff7fd5690c.tar.xz
Moved insertCallerSavingCode() to PhyRegAlloc and
moved isRegVolatile and modifiedByCall here: they are all machine independent. Remove all uses of PhyRegAlloc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7387 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target')
-rw-r--r--include/llvm/Target/TargetRegInfo.h41
1 files changed, 22 insertions, 19 deletions
diff --git a/include/llvm/Target/TargetRegInfo.h b/include/llvm/Target/TargetRegInfo.h
index 76e1daf222..44ba3e06f2 100644
--- a/include/llvm/Target/TargetRegInfo.h
+++ b/include/llvm/Target/TargetRegInfo.h
@@ -21,7 +21,6 @@ class Function;
class LiveRange;
class AddedInstrns;
class MachineInstr;
-class PhyRegAlloc;
class BasicBlock;
///----------------------------------------------------------------------------
@@ -75,9 +74,12 @@ public:
virtual void colorIGNode(IGNode *Node,
const std::vector<bool> &IsColorUsedArr) const = 0;
+ // Check whether a specific register is volatile, i.e., whether it is not
+ // preserved across calls
virtual bool isRegVolatile(int Reg) const = 0;
- // If any specific register needs extra information
+ // Check whether a specific register is modified as a side-effect of the
+ // call instruction itself,
virtual bool modifiedByCall(int Reg) const {return false; }
virtual const char* const getRegName(unsigned reg) const = 0;
@@ -151,27 +153,18 @@ public:
// as required. See SparcRegInfo.cpp for the implementation for Sparc.
//
virtual void suggestRegs4MethodArgs(const Function *Func,
- LiveRangeInfo &LRI) const = 0;
+ LiveRangeInfo& LRI) const = 0;
virtual void suggestRegs4CallArgs(MachineInstr *CallI,
- LiveRangeInfo &LRI) const = 0;
+ LiveRangeInfo& LRI) const = 0;
virtual void suggestReg4RetValue(MachineInstr *RetI,
- LiveRangeInfo &LRI) const = 0;
+ LiveRangeInfo& LRI) const = 0;
- virtual void colorMethodArgs(const Function *Func, LiveRangeInfo &LRI,
- AddedInstrns *FirstAI) const = 0;
-
- // Method for inserting caller saving code. The caller must save all the
- // volatile registers across a call based on the calling conventions of
- // an architecture. This must insert code for saving and restoring
- // such registers on
- //
- virtual void insertCallerSavingCode(std::vector<MachineInstr*>& instrnsBefore,
- std::vector<MachineInstr*>& instrnsAfter,
- MachineInstr *CallMI,
- const BasicBlock *BB,
- PhyRegAlloc &PRA) const = 0;
+ virtual void colorMethodArgs(const Function *Func,
+ LiveRangeInfo &LRI,
+ std::vector<MachineInstr*>& InstrnsBefore,
+ std::vector<MachineInstr*>& InstrnsAfter) const = 0;
// The following methods are used to generate "copy" machine instructions
// for an architecture. Currently they are used in TargetRegClass
@@ -204,7 +197,17 @@ public:
virtual void cpValue2Value(Value *Src, Value *Dest,
std::vector<MachineInstr*>& mvec) const = 0;
- virtual bool isRegVolatile(int RegClassID, int Reg) const = 0;
+ // Check whether a specific register is volatile, i.e., whether it is not
+ // preserved across calls
+ inline virtual bool isRegVolatile(int RegClassID, int Reg) const {
+ return MachineRegClassArr[RegClassID]->isRegVolatile(Reg);
+ }
+
+ // Check whether a specific register is modified as a side-effect of the
+ // call instruction itself,
+ inline virtual bool modifiedByCall(int RegClassID, int Reg) const {
+ return MachineRegClassArr[RegClassID]->modifiedByCall(Reg);
+ }
// Returns the reg used for pushing the address when a method is called.
// This can be used for other purposes between calls