projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
misched: Use the TargetSchedModel interface wherever possible.
[oota-llvm.git]
/
include
/
llvm
/
CodeGen
/
RegisterScavenging.h
diff --git
a/include/llvm/CodeGen/RegisterScavenging.h
b/include/llvm/CodeGen/RegisterScavenging.h
index 246831c034d4c5f4781b735b9da6a6105d135eef..3986a8dd7da15713efa2aa81b75534deb8c73230 100644
(file)
--- a/
include/llvm/CodeGen/RegisterScavenging.h
+++ b/
include/llvm/CodeGen/RegisterScavenging.h
@@
-68,6
+68,10
@@
class RegScavenger {
/// available, unset means the register is currently being used.
BitVector RegsAvailable;
/// available, unset means the register is currently being used.
BitVector RegsAvailable;
+ // These BitVectors are only used internally to forward(). They are members
+ // to avoid frequent reallocations.
+ BitVector KillRegs, DefRegs;
+
public:
RegScavenger()
: MBB(NULL), NumPhysRegs(0), Tracking(false),
public:
RegScavenger()
: MBB(NULL), NumPhysRegs(0), Tracking(false),
@@
-100,7
+104,7
@@
public:
/// getRegsAvailable - Return all available registers in the register class
/// in Mask.
/// getRegsAvailable - Return all available registers in the register class
/// in Mask.
-
void getRegsAvailable(const TargetRegisterClass *RC, BitVector &Mask
);
+
BitVector getRegsAvailable(const TargetRegisterClass *RC
);
/// FindUnusedReg - Find a unused register of the specified register class.
/// Return 0 if none is found.
/// FindUnusedReg - Find a unused register of the specified register class.
/// Return 0 if none is found.
@@
-130,8
+134,9
@@
private:
/// isUsed / isUnused - Test if a register is currently being used.
///
/// isUsed / isUnused - Test if a register is currently being used.
///
- bool isUsed(unsigned Reg) const { return !RegsAvailable.test(Reg); }
- bool isUnused(unsigned Reg) const { return RegsAvailable.test(Reg); }
+ bool isUsed(unsigned Reg) const {
+ return !RegsAvailable.test(Reg) || ReservedRegs.test(Reg);
+ }
/// isAliasUsed - Is Reg or an alias currently in use?
bool isAliasUsed(unsigned Reg) const;
/// isAliasUsed - Is Reg or an alias currently in use?
bool isAliasUsed(unsigned Reg) const;
@@
-139,7
+144,7
@@
private:
/// setUsed / setUnused - Mark the state of one or a number of registers.
///
void setUsed(BitVector &Regs) {
/// setUsed / setUnused - Mark the state of one or a number of registers.
///
void setUsed(BitVector &Regs) {
- RegsAvailable
&= ~Regs
;
+ RegsAvailable
.reset(Regs)
;
}
void setUnused(BitVector &Regs) {
RegsAvailable |= Regs;
}
void setUnused(BitVector &Regs) {
RegsAvailable |= Regs;
@@
-148,9
+153,6
@@
private:
/// Add Reg and all its sub-registers to BV.
void addRegWithSubRegs(BitVector &BV, unsigned Reg);
/// Add Reg and all its sub-registers to BV.
void addRegWithSubRegs(BitVector &BV, unsigned Reg);
- /// Add Reg and its aliases to BV.
- void addRegWithAliases(BitVector &BV, unsigned Reg);
-
/// findSurvivorReg - Return the candidate register that is unused for the
/// longest after StartMI. UseMI is set to the instruction where the search
/// stopped.
/// findSurvivorReg - Return the candidate register that is unused for the
/// longest after StartMI. UseMI is set to the instruction where the search
/// stopped.