Skip to content

Commit d7528ab

Browse files
Konstantin Vladimirovigcbot
authored andcommitted
fix for arg offsets processing in CISA builder
fix for arg offsets processing in CISA builder
1 parent 5d1f530 commit d7528ab

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXCisaBuilder.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ static cl::opt<bool> DisableNoMaskWA(
9898
"vc-cg-disable-no-mask-wa", cl::init(false), cl::Hidden,
9999
cl::desc("do not apply noMask WA (fusedEU)"));
100100

101+
static cl::opt<bool> OptStrictI64Check(
102+
"genx-cisa-builder-noi64-check", cl::init(false), cl::Hidden,
103+
cl::desc("strict check to ensure we produce no 64-bit operations"));
101104

102105
STATISTIC(NumVisaInsts, "Number of VISA instructions");
103106
STATISTIC(NumAsmInsts, "Number of Gen asm instructions");
@@ -1252,6 +1255,13 @@ void GenXKernelBuilder::buildInputs(Function *F, bool NeedRetIP) {
12521255
if (!PatchImpArgOff) {
12531256
Offset = TheKernelMetadata.getArgOffset(Idx);
12541257
}
1258+
else {
1259+
if ((Kind >> 3) == 3) {
1260+
Offset = GrfByteSize;
1261+
} else {
1262+
Offset = (TheKernelMetadata.getArgOffset(Idx) + GrfByteSize);
1263+
}
1264+
}
12551265
// Argument size in bytes.
12561266
const unsigned NumBytes = getInputSizeInBytes(
12571267
DL, TheKernelMetadata.getArgCategory(Idx), Arg->getType());
@@ -5850,6 +5860,9 @@ void GenXKernelBuilder::beginFunction(Function *Func) {
58505860
CISA_CALL(Kernel->GetPredefinedVar(R0, PREDEFINED_R0));
58515861
CISA_CALL(Kernel->CreateVISASrcOperand(OpSrc, R0, MODIFIER_NONE, 0, 1, 0,
58525862
0, 5));
5863+
if (OptStrictI64Check)
5864+
report_fatal_error("CisaBuilder should not produce 64-bit instructions"
5865+
" add64", false);
58535866
CISA_CALL(Kernel->AppendVISADataMovementInst(
58545867
ISA_MOV, nullptr, false, (NoMask ? vISA_EMASK_M1_NM : vISA_EMASK_M1),
58555868
EXEC_SIZE_1, SpOpDst, OpSrc));

0 commit comments

Comments
 (0)