forked from OSchip/llvm-project
Track reserved registers separately from RegsAvailable.
The bulk masking operations from register mask operands don't account for reserved registers. llvm-svn: 151222
This commit is contained in:
parent
93831264b3
commit
e664abb837
|
@ -134,8 +134,9 @@ private:
|
|||
|
||||
/// 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;
|
||||
|
|
|
@ -59,9 +59,6 @@ void RegScavenger::initRegState() {
|
|||
// All registers started out unused.
|
||||
RegsAvailable.set();
|
||||
|
||||
// Reserved registers are always used.
|
||||
RegsAvailable ^= ReservedRegs;
|
||||
|
||||
if (!MBB)
|
||||
return;
|
||||
|
||||
|
@ -225,9 +222,11 @@ void RegScavenger::forward() {
|
|||
|
||||
void RegScavenger::getRegsUsed(BitVector &used, bool includeReserved) {
|
||||
used = RegsAvailable;
|
||||
if (!includeReserved)
|
||||
used |= ReservedRegs;
|
||||
used.flip();
|
||||
if (includeReserved)
|
||||
used |= ReservedRegs;
|
||||
else
|
||||
used.reset(ReservedRegs);
|
||||
}
|
||||
|
||||
unsigned RegScavenger::FindUnusedReg(const TargetRegisterClass *RC) const {
|
||||
|
|
Loading…
Reference in New Issue