mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Switch to path halving from path compression for a small speedup. This also
makes getLeader() nonrecursive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122811 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ee38f85104
commit
26db45818a
@ -400,12 +400,18 @@ void StrongPHIElimination::addReg(unsigned Reg) {
|
||||
|
||||
StrongPHIElimination::Node*
|
||||
StrongPHIElimination::Node::getLeader() {
|
||||
Node* parentPointer = parent.getPointer();
|
||||
if (parentPointer == this)
|
||||
return this;
|
||||
Node* newParent = parentPointer->getLeader();
|
||||
parent.setPointer(newParent);
|
||||
return newParent;
|
||||
Node* N = this;
|
||||
Node* Parent = parent.getPointer();
|
||||
Node* Grandparent = Parent->parent.getPointer();
|
||||
|
||||
while (Parent != Grandparent) {
|
||||
N->parent.setPointer(Grandparent);
|
||||
N = Grandparent;
|
||||
Parent = Parent->parent.getPointer();
|
||||
Grandparent = Parent->parent.getPointer();
|
||||
}
|
||||
|
||||
return Parent;
|
||||
}
|
||||
|
||||
unsigned StrongPHIElimination::getRegColor(unsigned Reg) {
|
||||
|
Loading…
Reference in New Issue
Block a user