Skip to content

Commit 7043085

Browse files
sys-igcigcbot
authored andcommitted
[Autobackout][FunctionalRegression]Revert of change: 5f467c7: Make VRT GRF sizes backward-compatible in VC
If VRT GRF size is not supported for given platform, VC will look for closest largest value, e.g. on Xe2: 64->128, 96->128, 192->256.
1 parent d99d27f commit 7043085

File tree

4 files changed

+10
-62
lines changed

4 files changed

+10
-62
lines changed

IGC/VectorCompiler/include/GenXSubtarget.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,6 @@ class GenXSubtarget final : public GenXGenSubtargetInfo {
463463
PreDefined_Surface stackSurface() const { return StackSurf; }
464464

465465
bool isIntrinsicSupported(unsigned ID) const;
466-
467-
ArrayRef<unsigned> getSupportedGRFSizes() const;
468466
bool isValidGRFSize(unsigned Size) const;
469467
};
470468

IGC/VectorCompiler/lib/GenXCodeGen/GenXCisaBuilder.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -960,15 +960,8 @@ static void addKernelAttrsFromMetadata(VISAKernel &Kernel,
960960
// Set by compile option.
961961
if (BC->isAutoLargeGRFMode())
962962
NumGRF = 0;
963-
if (BC->getGRFSize()) {
963+
if (BC->getGRFSize())
964964
NumGRF = BC->getGRFSize();
965-
if (!Subtarget->isValidGRFSize(NumGRF)) {
966-
// looking for closest largest value
967-
const auto GrfSizes = Subtarget->getSupportedGRFSizes();
968-
auto It = std::upper_bound(GrfSizes.begin(), GrfSizes.end(), NumGRF);
969-
NumGRF = It != GrfSizes.end() ? *It : *(It - 1);
970-
}
971-
}
972965
// Set by kernel metadata.
973966
if (KM.getGRFSize()) {
974967
unsigned NumGRFPerKernel = *KM.getGRFSize();

IGC/VectorCompiler/lib/GenXCodeGen/GenXSubtarget.cpp

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ SPDX-License-Identifier: MIT
2727
#include "Probe/Assertion.h"
2828
#include "common/StringMacros.hpp"
2929

30-
#include <algorithm>
30+
#include <unordered_set>
3131

3232
using namespace llvm;
3333

@@ -296,30 +296,22 @@ bool GenXSubtarget::isInternalIntrinsicSupported(unsigned ID) const {
296296
return true;
297297
}
298298

299-
ArrayRef<unsigned> GenXSubtarget::getSupportedGRFSizes() const {
299+
bool GenXSubtarget::isValidGRFSize(unsigned Size) const {
300300
switch (TargetId) {
301301
case GenXSubtarget::XeHP:
302302
case GenXSubtarget::XeHPG:
303303
case GenXSubtarget::XeLPG:
304304
case GenXSubtarget::XeLPGPlus:
305305
case GenXSubtarget::XeHPC:
306306
case GenXSubtarget::XeHPCVG:
307-
case GenXSubtarget::Xe2: {
308-
static const unsigned Supported[] = {128, 256};
309-
return Supported;
310-
}
307+
case GenXSubtarget::Xe2:
308+
return Size == 128 || Size == 256;
311309
case GenXSubtarget::Xe3: {
312-
static const unsigned Supported[] = {32, 64, 96, 128, 160, 192, 256};
313-
return Supported;
314-
}
315-
default: {
316-
static const unsigned Supported[] = {128}; // platforms <= TGL
317-
return Supported;
310+
static const std::unordered_set<unsigned> Supported = {32, 64, 96, 128,
311+
160, 192, 256};
312+
return Supported.count(Size);
318313
}
314+
default:
315+
return Size == 128; // platforms <= TGL
319316
}
320317
}
321-
322-
bool GenXSubtarget::isValidGRFSize(unsigned Size) const {
323-
const auto GrfSizes = getSupportedGRFSizes();
324-
return std::binary_search(GrfSizes.begin(), GrfSizes.end(), Size);
325-
}

IGC/ocloc_tests/VC/vrt.ll

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)