Skip to content

Commit 098807f

Browse files
jfuentesigcbot
authored andcommitted
Changes in code.
1 parent 991b6b2 commit 098807f

File tree

3 files changed

+1
-48
lines changed

3 files changed

+1
-48
lines changed

visa/G4_Kernel.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff 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
//

visa/G4_Kernel.hpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff 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) {

visa/Optimizer.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)