Skip to content

Commit 15553d6

Browse files
pratikasharigcbot
authored andcommitted
Reset alignment only when avoidSrcDstOverlap WA is disabled
Reset alignment only when avoidSrcDstOverlap WA is disabled. This helps avoid some artificial interference edges.
1 parent ab8d937 commit 15553d6

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

visa/GraphColor.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10249,8 +10249,19 @@ bool GlobalRA::hybridRA(LocalRA &lra) {
1024910249
<< rpe.getMaxRP() << "\n");
1025010250
kernel.Declares.resize(numOrigDcl);
1025110251
lra.undoLocalRAAssignments(false);
10252-
// Restore alignment in case LRA modified it
10253-
copyAlignment();
10252+
// We check src/dst overlap WA because here to keep intf graph simple.
10253+
// When LRA is run, it sets augmentation alignment conservatively so
10254+
// that LRA assignments can co-exist with HRA assignments after
10255+
// augmentation is run. If we reset alignment here, it means that
10256+
// augmentation buckets are reset and alignment is copied over
10257+
// from original G4_Declare. This is correct behavior. However, when
10258+
// avoidSrcDstOverlap WA sees that src/dst of an instruction have no
10259+
// alignment, it forces an interference edge between them. This causes
10260+
// extra interferences in graph compared to case when we use conservative
10261+
// alignment computed in LRA. So when the WA is enabled, we avoid
10262+
// resetting alignment as it may produce better code.
10263+
if (!builder.avoidDstSrcOverlap() || use4GRFAlign)
10264+
copyAlignment();
1025410265
return false;
1025510266
}
1025610267

0 commit comments

Comments
 (0)