@@ -73,7 +73,10 @@ CheckInstrTypes::CheckInstrTypes(IGC::SInstrTypes* instrList) : FunctionPass(ID)
73
73
instrList->hasPointer = false ;
74
74
instrList->hasGenericAddressSpacePointers = false ;
75
75
instrList->hasLocalLoadStore = false ;
76
- instrList->hasBufferStore = false ;
76
+ instrList->hasGlobalLoad = false ;
77
+ instrList->hasGlobalStore = false ;
78
+ instrList->hasStorageBufferLoad = false ;
79
+ instrList->hasStorageBufferStore = false ;
77
80
instrList->hasSubroutines = false ;
78
81
instrList->hasPrimitiveAlloca = false ;
79
82
instrList->hasNonPrimitiveAlloca = false ;
@@ -85,6 +88,7 @@ CheckInstrTypes::CheckInstrTypes(IGC::SInstrTypes* instrList) : FunctionPass(ID)
85
88
instrList->hasAtomics = false ;
86
89
instrList->hasBarrier = false ;
87
90
instrList->hasDiscard = false ;
91
+ instrList->hasTypedRead = false ;
88
92
instrList->hasTypedwrite = false ;
89
93
instrList->mayHaveIndirectOperands = false ;
90
94
instrList->hasUniformAssumptions = false ;
@@ -238,6 +242,9 @@ void CheckInstrTypes::visitCallInst(CallInst& C)
238
242
case GenISAIntrinsic::GenISA_is_uniform:
239
243
g_InstrTypes->hasUniformAssumptions = true ;
240
244
break ;
245
+ case GenISAIntrinsic::GenISA_typedread:
246
+ g_InstrTypes->hasTypedRead = true ;
247
+ break ;
241
248
case GenISAIntrinsic::GenISA_typedwrite:
242
249
g_InstrTypes->hasTypedwrite = true ;
243
250
break ;
@@ -260,6 +267,28 @@ void CheckInstrTypes::visitCallInst(CallInst& C)
260
267
case GenISAIntrinsic::GenISA_PullCentroidBarys:
261
268
g_InstrTypes->hasPullBary = true ;
262
269
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
+ }
263
292
default :
264
293
break ;
265
294
}
@@ -326,13 +355,27 @@ void CheckInstrTypes::visitLoadInst(LoadInst& I)
326
355
{
327
356
g_InstrTypes->numInsts ++;
328
357
g_InstrTypes->hasLoadStore = true ;
329
- if (I.getPointerAddressSpace () == ADDRESS_SPACE_LOCAL)
358
+ uint as = I.getPointerAddressSpace ();
359
+ switch (as)
330
360
{
361
+ case ADDRESS_SPACE_LOCAL:
331
362
g_InstrTypes->hasLocalLoadStore = true ;
332
- }
333
- if (I.getPointerAddressSpace () == ADDRESS_SPACE_GENERIC)
334
- {
363
+ break ;
364
+ case ADDRESS_SPACE_GENERIC:
335
365
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
+ }
336
379
}
337
380
}
338
381
@@ -345,17 +388,26 @@ void CheckInstrTypes::visitStoreInst(StoreInst& I)
345
388
{
346
389
g_InstrTypes->psHasSideEffect = true ;
347
390
}
348
- if (as == ADDRESS_SPACE_LOCAL )
391
+ switch (as)
349
392
{
393
+ case ADDRESS_SPACE_LOCAL:
350
394
g_InstrTypes->hasLocalLoadStore = true ;
351
- }
352
- if (as == ADDRESS_SPACE_GENERIC)
353
- {
395
+ break ;
396
+ case ADDRESS_SPACE_GENERIC:
354
397
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 :
357
403
{
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
+ }
359
411
}
360
412
}
361
413
0 commit comments