@@ -2538,8 +2538,9 @@ bool SynchronizationObjectCoalescing::IsUrbWriteOperation(const llvm::Instructio
25382538 return false ;
25392539}
25402540
2541- // //////////////////////////////////////////////////////////////////////
2542- bool SynchronizationObjectCoalescing::IsBufferReadOperation (const llvm::Instruction* pInst)
2541+ // //////////////////////////////////////////////////////////////////////////////
2542+ inline llvm::Type* GetReadOperationPointerType (
2543+ const llvm::Instruction* pInst)
25432544{
25442545 if (llvm::isa<llvm::GenIntrinsicInst>(pInst))
25452546 {
@@ -2549,21 +2550,27 @@ bool SynchronizationObjectCoalescing::IsBufferReadOperation(const llvm::Instruct
25492550 {
25502551 case llvm::GenISAIntrinsic::GenISA_ldraw_indexed:
25512552 case llvm::GenISAIntrinsic::GenISA_ldrawvector_indexed:
2552- return IsGlobalResource (pGenIntrinsicInst->getOperand (0 )->getType ());
2553+ case llvm::GenISAIntrinsic::GenISA_simdBlockRead:
2554+ case llvm::GenISAIntrinsic::GenISA_simdBlockReadBindless:
2555+ case llvm::GenISAIntrinsic::GenISA_LSCLoad:
2556+ case llvm::GenISAIntrinsic::GenISA_LSCLoadWithSideEffects:
2557+ case llvm::GenISAIntrinsic::GenISA_LSCLoadBlock:
2558+ case llvm::GenISAIntrinsic::GenISA_LSCLoadCmask:
2559+ return pGenIntrinsicInst->getOperand (0 )->getType ();
25532560 default :
25542561 break ;
25552562 }
25562563 }
25572564 else if (llvm::isa<llvm::LoadInst>(pInst))
25582565 {
2559- return IsGlobalResource ( llvm::cast<llvm::LoadInst>(pInst)->getPointerOperandType () );
2566+ return llvm::cast<llvm::LoadInst>(pInst)->getPointerOperandType ();
25602567 }
2561-
2562- return false ;
2568+ return nullptr ;
25632569}
25642570
2565- // //////////////////////////////////////////////////////////////////////
2566- bool SynchronizationObjectCoalescing::IsBufferWriteOperation (const llvm::Instruction* pInst)
2571+ // //////////////////////////////////////////////////////////////////////////////
2572+ inline llvm::Type* GetWriteOperationPointerType (
2573+ const llvm::Instruction* pInst)
25672574{
25682575 if (llvm::isa<llvm::GenIntrinsicInst>(pInst))
25692576 {
@@ -2573,38 +2580,61 @@ bool SynchronizationObjectCoalescing::IsBufferWriteOperation(const llvm::Instruc
25732580 {
25742581 case llvm::GenISAIntrinsic::GenISA_storeraw_indexed:
25752582 case llvm::GenISAIntrinsic::GenISA_storerawvector_indexed:
2576- return IsGlobalResource (pGenIntrinsicInst->getOperand (0 )->getType ());
2583+ case llvm::GenISAIntrinsic::GenISA_simdBlockWrite:
2584+ case llvm::GenISAIntrinsic::GenISA_simdBlockWriteBindless:
2585+ case llvm::GenISAIntrinsic::GenISA_LSCStore:
2586+ case llvm::GenISAIntrinsic::GenISA_LSCStoreBlock:
2587+ case llvm::GenISAIntrinsic::GenISA_LSCStoreCmask:
2588+ return pGenIntrinsicInst->getOperand (0 )->getType ();
25772589 default :
25782590 break ;
25792591 }
25802592 }
25812593 else if (llvm::isa<llvm::StoreInst>(pInst))
25822594 {
2583- return IsGlobalResource ( llvm::cast<llvm::StoreInst>(pInst)->getPointerOperandType () );
2595+ return llvm::cast<llvm::StoreInst>(pInst)->getPointerOperandType ();
25842596 }
25852597
2598+ return nullptr ;
2599+ }
2600+
2601+ // //////////////////////////////////////////////////////////////////////
2602+ bool SynchronizationObjectCoalescing::IsBufferReadOperation (const llvm::Instruction* pInst)
2603+ {
2604+ if (llvm::Type* pPtrType = GetReadOperationPointerType (pInst))
2605+ {
2606+ return IsGlobalResource (pPtrType);
2607+ }
25862608 return false ;
25872609}
25882610
25892611// //////////////////////////////////////////////////////////////////////
2590- bool SynchronizationObjectCoalescing::IsSharedMemoryReadOperation (const llvm::Instruction* pInst)
2612+ bool SynchronizationObjectCoalescing::IsBufferWriteOperation (const llvm::Instruction* pInst)
25912613{
2592- if (llvm::isa<llvm::LoadInst> (pInst))
2614+ if (llvm::Type* pPtrType = GetWriteOperationPointerType (pInst))
25932615 {
2594- return IsSharedMemoryResource (llvm::cast<llvm::LoadInst>(pInst)-> getPointerOperandType () );
2616+ return IsGlobalResource (pPtrType );
25952617 }
2618+ return false ;
2619+ }
25962620
2621+ // //////////////////////////////////////////////////////////////////////
2622+ bool SynchronizationObjectCoalescing::IsSharedMemoryReadOperation (const llvm::Instruction* pInst)
2623+ {
2624+ if (llvm::Type* pPtrType = GetReadOperationPointerType (pInst))
2625+ {
2626+ return IsSharedMemoryResource (pPtrType);
2627+ }
25972628 return false ;
25982629}
25992630
26002631// //////////////////////////////////////////////////////////////////////
26012632bool SynchronizationObjectCoalescing::IsSharedMemoryWriteOperation (const llvm::Instruction* pInst)
26022633{
2603- if (llvm::isa<llvm::StoreInst> (pInst))
2634+ if (llvm::Type* pPtrType = GetWriteOperationPointerType (pInst))
26042635 {
2605- return IsSharedMemoryResource (llvm::cast<llvm::StoreInst>(pInst)-> getPointerOperandType () );
2636+ return IsSharedMemoryResource (pPtrType );
26062637 }
2607-
26082638 return false ;
26092639}
26102640
0 commit comments