Commit 89b7b774 authored by Junjie Gu's avatar Junjie Gu Committed by gbsbuild

Revert "[IGC Refactor][IGC]: Make sure isolated values are not in the linked list

Change-Id: I5674fdeb498800952c44187ddf8eba9425c780b6
parent 5fafbbf6
......@@ -386,7 +386,6 @@ void DeSSA::MapUnionRegs(MapVector<Value*, Node*> &Map, Value* Val1, Value* Val2
void DeSSA::isolateReg(Value* Val) {
Node *Node = RegNodeMap[Val];
splitNode(Node);
Node->parent.setInt(Node->parent.getInt() | Node::kRegisterIsolatedFlag);
}
......@@ -413,7 +412,6 @@ Value* DeSSA::getPHIRoot(Instruction *PHI) const {
void DeSSA::isolatePHI(Instruction *PHI) {
assert(isa<PHINode>(PHI));
Node *Node = RegNodeMap[PHI];
splitNode(Node);
Node->parent.setInt(Node->parent.getInt() | Node::kPHIIsolatedFlag);
}
......@@ -424,40 +422,6 @@ bool DeSSA::isPHIIsolated(Instruction *PHI) const {
return ((DestNode->parent.getInt() & Node::kPHIIsolatedFlag) > 0 ? true : false);
}
// Split node ND from its existing congurent class, and the
// node ND itself becomes a new single-value congruent class.
void DeSSA::splitNode(Node* ND)
{
Node* N = ND->next;
if (N == ND) {
// ND is already in a single-value congruent class
return;
}
// Remove ND from the congruent class
Node* P = ND->prev;
N->prev = P;
P->next = N;
// Make ND a new single-value congruent class
ND->parent.setPointer(ND);
ND->next = ND;
ND->prev = ND;
ND->rank = 0;
// Doing the path compression for the rooted tree of
// the existing congruent class after ND is removed
// from the congruent class.
P->parent.setPointer(P); // P is the new parent
P->rank = (P == N) ? 0 : 1;
while (N != P)
{
N->parent.setPointer(P);
N->rank = 0;
N = N->next;
}
}
/// SplitInterferencesForBasicBlock - traverses a basic block, splitting any
/// interferences found between registers in the same congruence class. It
/// takes two DenseMaps as arguments that it also updates:
......
......@@ -192,10 +192,6 @@ class DeSSA : public llvm::FunctionPass {
/// Isolate a PHI.
void isolatePHI(llvm::Instruction*);
// Split node from its existing congurent class, and
// node itself becomes a new single-value congruent class
void splitNode(Node* ND);
/// Traverses a basic block, splitting any interferences found between
/// registers in the same congruence class. It takes two DenseMaps as
/// arguments that it also updates: CurrentDominatingParent, which maps
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment