mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Speed up the AllocationOrder class a bit.
Allow the central functions to be inlined, and use the argumentless isHint() function when possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169319 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -35,6 +35,7 @@ AllocationOrder::AllocationOrder(unsigned VirtReg,
|
||||
const TargetRegisterInfo *TRI = &VRM.getTargetRegInfo();
|
||||
Order = RegClassInfo.getOrder(MF.getRegInfo().getRegClass(VirtReg));
|
||||
TRI->getRegAllocationHints(VirtReg, Order, Hints, MF, &VRM);
|
||||
rewind();
|
||||
|
||||
DEBUG({
|
||||
if (!Hints.empty()) {
|
||||
@ -45,21 +46,3 @@ AllocationOrder::AllocationOrder(unsigned VirtReg,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
bool AllocationOrder::isHint(unsigned PhysReg) const {
|
||||
return std::find(Hints.begin(), Hints.end(), PhysReg) != Hints.end();
|
||||
}
|
||||
|
||||
unsigned AllocationOrder::next() {
|
||||
if (Pos < Hints.size())
|
||||
return Hints[Pos++];
|
||||
ArrayRef<MCPhysReg>::iterator I = Order.begin() + (Pos - Hints.size());
|
||||
ArrayRef<MCPhysReg>::iterator E = Order.end();
|
||||
while (I != E) {
|
||||
unsigned Reg = *I++;
|
||||
++Pos;
|
||||
if (!isHint(Reg))
|
||||
return Reg;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user