Skip to content

Commit fccfff3

Browse files
DianaChenigcbot
authored andcommitted
[IGC IGA] Add warning for ternary instruction with invalid ARF
Report warning when non-null/acc arf register is used on ternary instruction.
1 parent 36400fe commit fccfff3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

visa/iga/IGALibrary/IR/Checker/IRChecker.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,21 @@ struct SemanticChecker : LOCChecker {
236236
}
237237
checkSrcScalarReg(i, src);
238238
checkMathSource(i, srcIx);
239+
checkTernarySource(i, srcIx);
240+
}
241+
242+
void checkTernarySource(const Instruction& i, int srcIx) {
243+
if (i.getSourceCount() != 3)
244+
return;
245+
auto& src = i.getSource(srcIx);
246+
if (src.isImm() || src.getDirRegName() == RegName::GRF_R)
247+
return;
248+
249+
// valid arf kind is acc and null
250+
if (src.getDirRegName() == RegName::ARF_ACC ||
251+
src.getDirRegName() == RegName::ARF_NULL)
252+
return;
253+
warning("Invalid ARF register file for ternary instructions");
239254
}
240255

241256
// Math can only have grf source with mme

0 commit comments

Comments
 (0)