@@ -73,7 +73,10 @@ CheckInstrTypes::CheckInstrTypes(IGC::SInstrTypes* instrList) : FunctionPass(ID)
7373 instrList->hasPointer = false ;
7474 instrList->hasGenericAddressSpacePointers = false ;
7575 instrList->hasLocalLoadStore = false ;
76- instrList->hasBufferStore = false ;
76+ instrList->hasGlobalLoad = false ;
77+ instrList->hasGlobalStore = false ;
78+ instrList->hasStorageBufferLoad = false ;
79+ instrList->hasStorageBufferStore = false ;
7780 instrList->hasSubroutines = false ;
7881 instrList->hasPrimitiveAlloca = false ;
7982 instrList->hasNonPrimitiveAlloca = false ;
@@ -85,6 +88,7 @@ CheckInstrTypes::CheckInstrTypes(IGC::SInstrTypes* instrList) : FunctionPass(ID)
8588 instrList->hasAtomics = false ;
8689 instrList->hasBarrier = false ;
8790 instrList->hasDiscard = false ;
91+ instrList->hasTypedRead = false ;
8892 instrList->hasTypedwrite = false ;
8993 instrList->mayHaveIndirectOperands = false ;
9094 instrList->hasUniformAssumptions = false ;
@@ -238,6 +242,9 @@ void CheckInstrTypes::visitCallInst(CallInst& C)
238242 case GenISAIntrinsic::GenISA_is_uniform:
239243 g_InstrTypes->hasUniformAssumptions = true ;
240244 break ;
245+ case GenISAIntrinsic::GenISA_typedread:
246+ g_InstrTypes->hasTypedRead = true ;
247+ break ;
241248 case GenISAIntrinsic::GenISA_typedwrite:
242249 g_InstrTypes->hasTypedwrite = true ;
243250 break ;
@@ -260,6 +267,28 @@ void CheckInstrTypes::visitCallInst(CallInst& C)
260267 case GenISAIntrinsic::GenISA_PullCentroidBarys:
261268 g_InstrTypes->hasPullBary = true ;
262269 break ;
270+ case GenISAIntrinsic::GenISA_ldraw_indexed:
271+ case GenISAIntrinsic::GenISA_ldrawvector_indexed:
272+ {
273+ BufferType bufferType = DecodeBufferType (
274+ CI->getArgOperand (0 )->getType ()->getPointerAddressSpace ());
275+ if (bufferType == UAV || bufferType == BINDLESS)
276+ {
277+ g_InstrTypes->hasStorageBufferLoad = true ;
278+ }
279+ break ;
280+ }
281+ case GenISAIntrinsic::GenISA_storeraw_indexed:
282+ case GenISAIntrinsic::GenISA_storerawvector_indexed:
283+ {
284+ BufferType bufferType = DecodeBufferType (
285+ CI->getArgOperand (0 )->getType ()->getPointerAddressSpace ());
286+ if (bufferType == UAV || bufferType == BINDLESS)
287+ {
288+ g_InstrTypes->hasStorageBufferStore = true ;
289+ }
290+ break ;
291+ }
263292 default :
264293 break ;
265294 }
@@ -326,13 +355,27 @@ void CheckInstrTypes::visitLoadInst(LoadInst& I)
326355{
327356 g_InstrTypes->numInsts ++;
328357 g_InstrTypes->hasLoadStore = true ;
329- if (I.getPointerAddressSpace () == ADDRESS_SPACE_LOCAL)
358+ uint as = I.getPointerAddressSpace ();
359+ switch (as)
330360 {
361+ case ADDRESS_SPACE_LOCAL:
331362 g_InstrTypes->hasLocalLoadStore = true ;
332- }
333- if (I.getPointerAddressSpace () == ADDRESS_SPACE_GENERIC)
334- {
363+ break ;
364+ case ADDRESS_SPACE_GENERIC:
335365 g_InstrTypes->hasGenericAddressSpacePointers = true ;
366+ break ;
367+ case ADDRESS_SPACE_GLOBAL:
368+ g_InstrTypes->hasGlobalLoad = true ;
369+ break ;
370+ default :
371+ {
372+ BufferType bufferType = DecodeBufferType (as);
373+ if (bufferType == UAV || bufferType == BINDLESS)
374+ {
375+ g_InstrTypes->hasStorageBufferLoad = true ;
376+ }
377+ break ;
378+ }
336379 }
337380}
338381
@@ -345,17 +388,26 @@ void CheckInstrTypes::visitStoreInst(StoreInst& I)
345388 {
346389 g_InstrTypes->psHasSideEffect = true ;
347390 }
348- if (as == ADDRESS_SPACE_LOCAL )
391+ switch (as)
349392 {
393+ case ADDRESS_SPACE_LOCAL:
350394 g_InstrTypes->hasLocalLoadStore = true ;
351- }
352- if (as == ADDRESS_SPACE_GENERIC)
353- {
395+ break ;
396+ case ADDRESS_SPACE_GENERIC:
354397 g_InstrTypes->hasGenericAddressSpacePointers = true ;
355- }
356- if (as == ADDRESS_SPACE_GLOBAL)
398+ break ;
399+ case ADDRESS_SPACE_GLOBAL:
400+ g_InstrTypes->hasGlobalStore = true ;
401+ break ;
402+ default :
357403 {
358- g_InstrTypes->hasBufferStore = true ;
404+ BufferType bufferType = DecodeBufferType (as);
405+ if (bufferType == UAV || bufferType == BINDLESS)
406+ {
407+ g_InstrTypes->hasStorageBufferStore = true ;
408+ }
409+ break ;
410+ }
359411 }
360412}
361413
0 commit comments