@@ -2538,8 +2538,9 @@ bool SynchronizationObjectCoalescing::IsUrbWriteOperation(const llvm::Instructio
2538
2538
return false ;
2539
2539
}
2540
2540
2541
- // //////////////////////////////////////////////////////////////////////
2542
- bool SynchronizationObjectCoalescing::IsBufferReadOperation (const llvm::Instruction* pInst)
2541
+ // //////////////////////////////////////////////////////////////////////////////
2542
+ inline llvm::Type* GetReadOperationPointerType (
2543
+ const llvm::Instruction* pInst)
2543
2544
{
2544
2545
if (llvm::isa<llvm::GenIntrinsicInst>(pInst))
2545
2546
{
@@ -2549,21 +2550,27 @@ bool SynchronizationObjectCoalescing::IsBufferReadOperation(const llvm::Instruct
2549
2550
{
2550
2551
case llvm::GenISAIntrinsic::GenISA_ldraw_indexed:
2551
2552
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 ();
2553
2560
default :
2554
2561
break ;
2555
2562
}
2556
2563
}
2557
2564
else if (llvm::isa<llvm::LoadInst>(pInst))
2558
2565
{
2559
- return IsGlobalResource ( llvm::cast<llvm::LoadInst>(pInst)->getPointerOperandType () );
2566
+ return llvm::cast<llvm::LoadInst>(pInst)->getPointerOperandType ();
2560
2567
}
2561
-
2562
- return false ;
2568
+ return nullptr ;
2563
2569
}
2564
2570
2565
- // //////////////////////////////////////////////////////////////////////
2566
- bool SynchronizationObjectCoalescing::IsBufferWriteOperation (const llvm::Instruction* pInst)
2571
+ // //////////////////////////////////////////////////////////////////////////////
2572
+ inline llvm::Type* GetWriteOperationPointerType (
2573
+ const llvm::Instruction* pInst)
2567
2574
{
2568
2575
if (llvm::isa<llvm::GenIntrinsicInst>(pInst))
2569
2576
{
@@ -2573,38 +2580,61 @@ bool SynchronizationObjectCoalescing::IsBufferWriteOperation(const llvm::Instruc
2573
2580
{
2574
2581
case llvm::GenISAIntrinsic::GenISA_storeraw_indexed:
2575
2582
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 ();
2577
2589
default :
2578
2590
break ;
2579
2591
}
2580
2592
}
2581
2593
else if (llvm::isa<llvm::StoreInst>(pInst))
2582
2594
{
2583
- return IsGlobalResource ( llvm::cast<llvm::StoreInst>(pInst)->getPointerOperandType () );
2595
+ return llvm::cast<llvm::StoreInst>(pInst)->getPointerOperandType ();
2584
2596
}
2585
2597
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
+ }
2586
2608
return false ;
2587
2609
}
2588
2610
2589
2611
// //////////////////////////////////////////////////////////////////////
2590
- bool SynchronizationObjectCoalescing::IsSharedMemoryReadOperation (const llvm::Instruction* pInst)
2612
+ bool SynchronizationObjectCoalescing::IsBufferWriteOperation (const llvm::Instruction* pInst)
2591
2613
{
2592
- if (llvm::isa<llvm::LoadInst> (pInst))
2614
+ if (llvm::Type* pPtrType = GetWriteOperationPointerType (pInst))
2593
2615
{
2594
- return IsSharedMemoryResource (llvm::cast<llvm::LoadInst>(pInst)-> getPointerOperandType () );
2616
+ return IsGlobalResource (pPtrType );
2595
2617
}
2618
+ return false ;
2619
+ }
2596
2620
2621
+ // //////////////////////////////////////////////////////////////////////
2622
+ bool SynchronizationObjectCoalescing::IsSharedMemoryReadOperation (const llvm::Instruction* pInst)
2623
+ {
2624
+ if (llvm::Type* pPtrType = GetReadOperationPointerType (pInst))
2625
+ {
2626
+ return IsSharedMemoryResource (pPtrType);
2627
+ }
2597
2628
return false ;
2598
2629
}
2599
2630
2600
2631
// //////////////////////////////////////////////////////////////////////
2601
2632
bool SynchronizationObjectCoalescing::IsSharedMemoryWriteOperation (const llvm::Instruction* pInst)
2602
2633
{
2603
- if (llvm::isa<llvm::StoreInst> (pInst))
2634
+ if (llvm::Type* pPtrType = GetWriteOperationPointerType (pInst))
2604
2635
{
2605
- return IsSharedMemoryResource (llvm::cast<llvm::StoreInst>(pInst)-> getPointerOperandType () );
2636
+ return IsSharedMemoryResource (pPtrType );
2606
2637
}
2607
-
2608
2638
return false ;
2609
2639
}
2610
2640
0 commit comments