Skip to content

Commit 09b42cd

Browse files
igorban-inteligcbot
authored andcommitted
Fix isAnyNonTrivialIntrinsic-calls for internal intrinsics
.
1 parent f6b3152 commit 09b42cd

File tree

5 files changed

+13
-17
lines changed

5 files changed

+13
-17
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXArgIndirection.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,11 +1058,11 @@ void SubroutineArg::gatherBalesToModify(Alignment Align)
10581058
// Add the def to the list of bales that will need modifying, unless
10591059
// it is a phi node or coalesced bitcast or insert/extract in struct
10601060
// or a non-intrinsic call.
1061-
if (!isa<PHINode>(Inst) && (!isa<BitCastInst>(Inst)
1062-
|| Pass->Liveness->getLiveRange(Inst->getOperand(0)) != ArgLR)
1063-
&& !isa<InsertValueInst>(Inst) && !isa<ExtractValueInst>(Inst)
1064-
&& (!isa<CallInst>(Inst)
1065-
|| GenXIntrinsic::isAnyNonTrivialIntrinsic(Inst)))
1061+
if (!isa<PHINode>(Inst) &&
1062+
(!isa<BitCastInst>(Inst) ||
1063+
Pass->Liveness->getLiveRange(Inst->getOperand(0)) != ArgLR) &&
1064+
!isa<InsertValueInst>(Inst) && !isa<ExtractValueInst>(Inst) &&
1065+
(!isa<CallInst>(Inst) || vc::isAnyNonTrivialIntrinsic(Inst)))
10661066
if (BalesSeen.insert(Inst).second)
10671067
Pass->BalesToModify.push_back(Inst);
10681068
} else if (V != Arg)
@@ -1071,8 +1071,7 @@ void SubroutineArg::gatherBalesToModify(Alignment Align)
10711071
auto User = cast<Instruction>(ui->getUser());
10721072
if (auto CI = dyn_cast<CallInst>(User)) {
10731073
Function *CF = CI->getCalledFunction();
1074-
if (!GenXIntrinsic::isAnyNonTrivialIntrinsic(CF) &&
1075-
!vc::requiresStackCall(CF)) {
1074+
if (!vc::isAnyNonTrivialIntrinsic(CF) && !vc::requiresStackCall(CF)) {
10761075
// Non-intrinsic call. Ignore. (A call site using an arg being
10771076
// indirected gets handled differently.)
10781077
// Cannot indirect if there is a stack call. Do not ignore stack
@@ -1127,7 +1126,7 @@ bool GenXArgIndirection::checkIndirectBale(Bale *B, LiveRange *ArgLR,
11271126
return false;
11281127
}
11291128
unsigned IID = vc::getAnyIntrinsicID(MainInst->Inst);
1130-
if (GenXIntrinsic::isAnyNonTrivialIntrinsic(IID)) {
1129+
if (vc::isAnyNonTrivialIntrinsic(IID)) {
11311130
auto IntrInfo = GenXIntrinsicInfo(IID);
11321131
// Cannot indirect a raw or direct only operand.
11331132
bool RawOrDirectOnly =

IGC/VectorCompiler/lib/GenXCodeGen/GenXBaling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2097,7 +2097,7 @@ void GenXBaling::buildBaleSub(Instruction *Inst, Bale *B, bool IncludeAddr) cons
20972097

20982098
if (isa<PHINode>(Inst) ||
20992099
(isa<CallInst>(Inst) && !cast<CallInst>(Inst)->isInlineAsm() &&
2100-
!GenXIntrinsic::isAnyNonTrivialIntrinsic(Inst)))
2100+
!vc::isAnyNonTrivialIntrinsic(Inst)))
21012101
return;
21022102
if (IncludeAddr) {
21032103
int AddrOperandNum = getAddrOperandNum(GenXIntrinsic::getGenXIntrinsicID(Inst));

IGC/VectorCompiler/lib/GenXCodeGen/GenXDepressurizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ void GenXDepressurizer::processInstruction(Instruction *Inst) {
729729
Live->removeValue(Inst);
730730
// If this is a non-intrisic call, add the max pressure from inside the call.
731731
if (auto CI = dyn_cast<CallInst>(Inst)) {
732-
if (!GenXIntrinsic::isAnyNonTrivialIntrinsic(CI)) {
732+
if (!vc::isAnyNonTrivialIntrinsic(CI)) {
733733
LLVM_DEBUG(dbgs() << "pressure inside subroutine: "
734734
<< SubroutinePressures[CI->getCalledFunction()]
735735
<< '\n');

IGC/VectorCompiler/lib/GenXCodeGen/GenXPrologEpilogInsertion.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ void GenXPrologEpilogInsertion::emitPrivateMemoryAllocations() {
767767
void GenXPrologEpilogInsertion::visitCallInst(CallInst &I) {
768768
if (I.isInlineAsm())
769769
return;
770-
if (GenXIntrinsic::isAnyNonTrivialIntrinsic(&I))
770+
if (vc::isAnyNonTrivialIntrinsic(&I))
771771
return;
772772
bool IsIndirectCall = I.isIndirectCall();
773773
// FIXME: Temporary solution until SPIRV translator conversion of unnamed
@@ -777,8 +777,7 @@ void GenXPrologEpilogInsertion::visitCallInst(CallInst &I) {
777777
if (auto *CE = dyn_cast<ConstantExpr>(Op);
778778
CE && CE->getOpcode() == Instruction::BitCast) {
779779
auto *CalledFunction = cast<Function>(CE->getOperand(0));
780-
IsIntrinsicIndirect =
781-
GenXIntrinsic::isAnyNonTrivialIntrinsic(CalledFunction);
780+
IsIntrinsicIndirect = vc::isAnyNonTrivialIntrinsic(CalledFunction);
782781
IGC_ASSERT_MESSAGE(IsIntrinsicIndirect, "Only intrinsic is expected");
783782
}
784783

IGC/VectorCompiler/lib/GenXCodeGen/GenXVectorDecomposer.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,7 @@ bool VectorDecomposer::determineDecomposition(Instruction *Inst) {
208208
setNotDecomposing(Inst, "use of function argument or constant");
209209
} else {
210210
// Any other def. This stops decomposition.
211-
if ((isa<CallInst>(Inst) &&
212-
!GenXIntrinsic::isAnyNonTrivialIntrinsic(Inst)) ||
211+
if ((isa<CallInst>(Inst) && !vc::isAnyNonTrivialIntrinsic(Inst)) ||
213212
isa<ExtractValueInst>(Inst))
214213
setNotDecomposing(Inst, "return value from call");
215214
else
@@ -246,8 +245,7 @@ bool VectorDecomposer::determineDecomposition(Instruction *Inst) {
246245
// in the Seen set.)
247246
if (isa<InsertValueInst>(user) || isa<ReturnInst>(user))
248247
setNotDecomposing(user, "use as return value");
249-
else if (isa<CallInst>(user) &&
250-
!GenXIntrinsic::isAnyNonTrivialIntrinsic(user))
248+
else if (isa<CallInst>(user) && !vc::isAnyNonTrivialIntrinsic(user))
251249
setNotDecomposing(user, "use as call argument");
252250
else
253251
setNotDecomposing(user, "other non-decomposable use");

0 commit comments

Comments
 (0)