Skip to content

Commit 6cbcca3

Browse files
mmereckiigcbot
authored andcommitted
[CoalescingEngine] Fix entire congruence class eviction
Fix eviction of entire congruence class in cases when the root node does not dominate the new tuple-using instruction. In such cases all nodes must be isolated, not only the root node.
1 parent 78585be commit 6cbcca3

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

IGC/Compiler/CISACodeGen/CoalescingEngine.cpp

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -773,22 +773,20 @@ namespace IGC
773773
IGC_ASSERT(RootNode);
774774

775775
if (evictFullCongruenceClass) {
776-
Value* NewParent = GetActualDominatingParent(RootNode->value, inst);
777-
778-
while (NewParent) {
779-
if (getRegRoot(NewParent)) {
780-
isolateReg(NewParent);
776+
Value* dominatingParent = GetActualDominatingParent(RootNode->value, inst);
777+
// It might turn out that the root node does not dominate the
778+
// 'inst' since it is in an another branch of DT. In such case,
779+
// isolate all nodes in the CC.
780+
llvm::Value* CCVal = dominatingParent ?
781+
dominatingParent : CurrentDominatingParent[RootNode->value];
782+
while (CCVal)
783+
{
784+
if (getRegRoot(CCVal))
785+
{
786+
isolateReg(CCVal);
781787
}
782-
NewParent = ImmediateDominatingParent[NewParent];
788+
CCVal = ImmediateDominatingParent[CCVal];
783789
}
784-
785-
//it might turn out, that rootNode does not dominate 'inst'
786-
//since it is in another branch of DT
787-
//do not forget to delete it as well
788-
if (getRegRoot(RootNode->value)) {
789-
isolateReg(RootNode->value);
790-
}
791-
792790
}
793791
else {
794792
//Evict dominating parent from CC.

0 commit comments

Comments
 (0)