Skip to content

Commit 36400fe

Browse files
bcheng0127igcbot
authored andcommitted
Enable round robin RA for address register
Enable round robin RA for address register to reduce WAR dependence from address register
1 parent b3d105c commit 36400fe

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

visa/GraphColor.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7755,8 +7755,13 @@ bool GraphColor::regAlloc(bool doBankConflictReduction,
77557755
assignColors(FIRST_FIT);
77567756
}
77577757
} else {
7758-
// assign registers for ARFs using a first-fit heuristic
7759-
assignColors(FIRST_FIT, false, false);
7758+
// assign registers for ARFs using a round-robin heuristic
7759+
// For address register, there is no fragment issue
7760+
if (builder.doRRForAddressRA()) {
7761+
assignColors(ROUND_ROBIN, false, false);
7762+
} else {
7763+
assignColors(FIRST_FIT, false, false);
7764+
}
77607765
}
77617766

77627767
return (requireSpillCode() == false);

visa/HWCaps.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,10 @@ bool needA0WAR() const {
904904
return (getPlatform() >= Xe2);
905905
}
906906

907+
bool doRRForAddressRA() const {
908+
return (getPlatform() >= Xe3);
909+
}
910+
907911
bool alwaysAllowGlobalFlagOpt() const {
908912
// We shouldn't add this kind of ugly platform check. However, there's
909913
// a complicated bug found in TGLLP when disabling a flagopt case. There

0 commit comments

Comments
 (0)