Skip to content

Commit 8bd47c6

Browse files
pratikasharsys_zuul
authored andcommitted
Add support for explicit split coalescing in LRA
Change-Id: I5129f237e80426c54e110e10ebe5e6c1a7604088
1 parent de3fa95 commit 8bd47c6

File tree

3 files changed

+140
-122
lines changed

3 files changed

+140
-122
lines changed

visa/GraphColor.cpp

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9181,23 +9181,26 @@ bool GlobalRA::hybridRA(bool doBankConflictReduction, bool highInternalConflict,
91819181
return true;
91829182
}
91839183

9184-
bool canDoLRA(G4_Kernel& kernel)
9184+
bool canDoHRA(G4_Kernel& kernel)
91859185
{
91869186
bool ret = true;
91879187

9188-
91899188
if (kernel.getVarSplitPass()->splitOccured())
91909189
{
9191-
// skip LRA when split changes IR as it may
9192-
// result in copies in the program. coalescing
9193-
// requires more work in LRA because preRA
9194-
// scheduler schedules sampler and split nodes.
91959190
ret = false;
91969191
}
91979192

91989193
return ret;
91999194
}
92009195

9196+
bool canDoLRA(G4_Kernel& kernel)
9197+
{
9198+
bool ret = true;
9199+
9200+
9201+
return ret;
9202+
}
9203+
92019204
//
92029205
// graph coloring entry point. returns nonzero if RA fails
92039206
//
@@ -9259,9 +9262,20 @@ int GlobalRA::coloringRegAlloc()
92599262
stopTimer(TIMER_LOCAL_RA);
92609263
if (!success)
92619264
{
9262-
startTimer(TIMER_HYBRID_RA);
9263-
success = hybridRA(lra.doHybridBCR(), lra.hasHighInternalBC(), lra);
9264-
stopTimer(TIMER_HYBRID_RA);
9265+
if (canDoHRA(kernel))
9266+
{
9267+
startTimer(TIMER_HYBRID_RA);
9268+
success = hybridRA(lra.doHybridBCR(), lra.hasHighInternalBC(), lra);
9269+
stopTimer(TIMER_HYBRID_RA);
9270+
}
9271+
else
9272+
{
9273+
if (builder.getOption(vISA_RATrace))
9274+
{
9275+
std::cout << "\t--skip HRA due to var split. undo LRA results." << "\n";
9276+
}
9277+
lra.undoLocalRAAssignments(false);
9278+
}
92659279
}
92669280
if (success)
92679281
{

0 commit comments

Comments
 (0)