File tree Expand file tree Collapse file tree 3 files changed +1
-48
lines changed Expand file tree Collapse file tree 3 files changed +1
-48
lines changed Original file line number Diff line number Diff line change @@ -627,19 +627,6 @@ bool G4_Kernel::canUpdateKernelToLargerGRF() {
627627 return true ;
628628}
629629
630- //
631- // Updates kernel's related structures to smaller GRF
632- //
633- bool G4_Kernel::updateKernelToSmallerGRF () {
634- if (numRegTotal == grfMode.getMinGRF ())
635- return false ;
636-
637- // Scale number of GRFs, Acc, SWSB tokens.
638- setKernelParameters (grfMode.moveToSmallerGRF ());
639- fg.builder ->rebuildPhyRegPool (getNumRegTotal ());
640- return true ;
641- }
642-
643630//
644631// Updates kernel's related structures to large GRF
645632//
Original file line number Diff line number Diff line change @@ -223,23 +223,12 @@ class GRFMode {
223223 // Get the next smaller GRF available
224224 unsigned getSmallerGRF () const {
225225 for (auto i = static_cast <int >(currentMode) - 1 ; i >= 0 ; --i) {
226- if (configs[i].VRTEnable && configs[i]. numGRF >= lowerBoundGRF )
226+ if (configs[i].VRTEnable )
227227 return configs[i].numGRF ;
228228 }
229229 return configs[currentMode].numGRF ;
230230 }
231231
232- // Move GRF mode to the smaller GRF available and return the number
233- unsigned moveToSmallerGRF () {
234- for (auto i = static_cast <int >(currentMode) - 1 ; i >= 0 ; --i) {
235- if (configs[i].VRTEnable && configs[i].numGRF >= lowerBoundGRF) {
236- currentMode = i;
237- break ;
238- }
239- }
240- return configs[currentMode].numGRF ;
241- }
242-
243232 // Move GRF mode to the larger GRF available and return the number
244233 unsigned moveToLargerGRF () {
245234 for (auto i = currentMode + 1 ; i < configs.size (); ++i) {
Original file line number Diff line number Diff line change @@ -228,29 +228,6 @@ void Optimizer::regAlloc() {
228228 } else if (status != VISA_SUCCESS) {
229229 RAFail = true ;
230230 }
231-
232- if (status == VISA_SUCCESS && kernel.useAutoGRFSelection () &&
233- kernel.getNumRegTotal () != kernel.grfMode .getMinGRF ()) {
234- // There might be cases where RA is able to allocate less register
235- // than the GRF selected in Pre-RA scheduler which is based on
236- // register pressure.
237- // If that's the case, update the GRF number based on the largest
238- // register assignment by RA.
239- int largestGRF = 0 ;
240- for (auto dcl : kernel.Declares ) {
241- if (dcl->getRegVar ()->isGreg ()) {
242- int GRFStart = dcl->getRegVar ()->getPhyReg ()->asGreg ()->getRegNum ();
243- int numRows = dcl->getNumRows ();
244- int GRFEnd = GRFStart + numRows;
245- if (GRFEnd > largestGRF) {
246- largestGRF = GRFEnd;
247- }
248- }
249- }
250- int smallerGRF = kernel.grfMode .getSmallerGRF ();
251- if (largestGRF <= smallerGRF)
252- kernel.updateKernelToSmallerGRF ();
253- }
254231}
255232
256233// HW debugging needs to zero certain ARF registers such as a0, acc, etc.
You can’t perform that action at this time.
0 commit comments