Skip to content

Commit f6c0fb7

Browse files
mmereckiigcbot
authored andcommitted
Detect GEP instructions into vectors
Detect GEP instructions into vectors
1 parent d0c0795 commit f6c0fb7

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

IGC/Compiler/CISACodeGen/CheckInstrTypes.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ void CheckInstrTypes::print(llvm::raw_ostream& OS) const
171171
OS << "\nhasDynamicGenericLoadStore: " << g_InstrTypes.hasDynamicGenericLoadStore;
172172
OS << "\nhasUnmaskedRegion: " << g_InstrTypes.hasUnmaskedRegion;
173173
OS << "\nhasSLM: " << g_InstrTypes.hasSLM;
174+
OS << "\nhasPrivateGEPIntoVector: " << g_InstrTypes.hasPrivateGEPIntoVector;
174175
OS << "\nnumCall: " << g_InstrTypes.numCall;
175176
OS << "\nnumBarrier: " << g_InstrTypes.numBarrier;
176177
OS << "\nnumLoadStore: " << g_InstrTypes.numLoadStore;
@@ -754,6 +755,20 @@ void CheckInstrTypes::visitGetElementPtrInst(llvm::GetElementPtrInst& I)
754755
{
755756
g_InstrTypes.hasGenericAddressSpacePointers = true;
756757
}
758+
else if (I.getPointerAddressSpace() == ADDRESS_SPACE::ADDRESS_SPACE_PRIVATE &&
759+
g_InstrTypes.hasPrivateGEPIntoVector == false &&
760+
I.getNumIndices() > 1)
761+
{
762+
llvm::SmallVector<llvm::Value*, 4> indices(I.indices());
763+
indices.pop_back();
764+
llvm::Type* lastIndexedType = llvm::GetElementPtrInst::getIndexedType(
765+
I.getSourceElementType(),
766+
indices);
767+
if (lastIndexedType->isVectorTy())
768+
{
769+
g_InstrTypes.hasPrivateGEPIntoVector = true;
770+
}
771+
}
757772
}
758773

759774
#undef PASS_FLAG

IGC/Compiler/CodeGenPublic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ namespace IGC
348348
bool hasDynamicGenericLoadStore{};
349349
bool hasUnmaskedRegion{};
350350
bool hasSLM{};
351+
bool hasPrivateGEPIntoVector{};
351352
unsigned int numCall{};
352353
unsigned int numBarrier{};
353354
unsigned int numLoadStore{};

0 commit comments

Comments
 (0)