Skip to content

Commit 496d487

Browse files
sys-igcigcbot
authored andcommitted
[Autobackout][FunctionalRegression]Revert of change: 2361621: Support more intrinsics in SynchronizationObjectCoalescing
Add support for more load and store intrinsics to `SynchronizationObjectCoalescing`
1 parent 8e50c90 commit 496d487

File tree

1 file changed

+16
-46
lines changed

1 file changed

+16
-46
lines changed

IGC/Compiler/Optimizer/SynchronizationObjectCoalescing.cpp

Lines changed: 16 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,9 +2538,8 @@ bool SynchronizationObjectCoalescing::IsUrbWriteOperation(const llvm::Instructio
25382538
return false;
25392539
}
25402540

2541-
////////////////////////////////////////////////////////////////////////////////
2542-
inline llvm::Type* GetReadOperationPointerType(
2543-
const llvm::Instruction* pInst)
2541+
////////////////////////////////////////////////////////////////////////
2542+
bool SynchronizationObjectCoalescing::IsBufferReadOperation(const llvm::Instruction* pInst)
25442543
{
25452544
if (llvm::isa<llvm::GenIntrinsicInst>(pInst))
25462545
{
@@ -2550,27 +2549,21 @@ inline llvm::Type* GetReadOperationPointerType(
25502549
{
25512550
case llvm::GenISAIntrinsic::GenISA_ldraw_indexed:
25522551
case llvm::GenISAIntrinsic::GenISA_ldrawvector_indexed:
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();
2552+
return IsGlobalResource(pGenIntrinsicInst->getOperand(0)->getType());
25602553
default:
25612554
break;
25622555
}
25632556
}
25642557
else if (llvm::isa<llvm::LoadInst>(pInst))
25652558
{
2566-
return llvm::cast<llvm::LoadInst>(pInst)->getPointerOperandType();
2559+
return IsGlobalResource(llvm::cast<llvm::LoadInst>(pInst)->getPointerOperandType());
25672560
}
2568-
return nullptr;
2561+
2562+
return false;
25692563
}
25702564

2571-
////////////////////////////////////////////////////////////////////////////////
2572-
inline llvm::Type* GetWriteOperationPointerType(
2573-
const llvm::Instruction* pInst)
2565+
////////////////////////////////////////////////////////////////////////
2566+
bool SynchronizationObjectCoalescing::IsBufferWriteOperation(const llvm::Instruction* pInst)
25742567
{
25752568
if (llvm::isa<llvm::GenIntrinsicInst>(pInst))
25762569
{
@@ -2580,61 +2573,38 @@ inline llvm::Type* GetWriteOperationPointerType(
25802573
{
25812574
case llvm::GenISAIntrinsic::GenISA_storeraw_indexed:
25822575
case llvm::GenISAIntrinsic::GenISA_storerawvector_indexed:
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();
2576+
return IsGlobalResource(pGenIntrinsicInst->getOperand(0)->getType());
25892577
default:
25902578
break;
25912579
}
25922580
}
25932581
else if (llvm::isa<llvm::StoreInst>(pInst))
25942582
{
2595-
return llvm::cast<llvm::StoreInst>(pInst)->getPointerOperandType();
2583+
return IsGlobalResource(llvm::cast<llvm::StoreInst>(pInst)->getPointerOperandType());
25962584
}
25972585

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-
}
2608-
return false;
2609-
}
2610-
2611-
////////////////////////////////////////////////////////////////////////
2612-
bool SynchronizationObjectCoalescing::IsBufferWriteOperation(const llvm::Instruction* pInst)
2613-
{
2614-
if (llvm::Type* pPtrType = GetWriteOperationPointerType(pInst))
2615-
{
2616-
return IsGlobalResource(pPtrType);
2617-
}
26182586
return false;
26192587
}
26202588

26212589
////////////////////////////////////////////////////////////////////////
26222590
bool SynchronizationObjectCoalescing::IsSharedMemoryReadOperation(const llvm::Instruction* pInst)
26232591
{
2624-
if (llvm::Type* pPtrType = GetReadOperationPointerType(pInst))
2592+
if (llvm::isa<llvm::LoadInst>(pInst))
26252593
{
2626-
return IsSharedMemoryResource(pPtrType);
2594+
return IsSharedMemoryResource(llvm::cast<llvm::LoadInst>(pInst)->getPointerOperandType());
26272595
}
2596+
26282597
return false;
26292598
}
26302599

26312600
////////////////////////////////////////////////////////////////////////
26322601
bool SynchronizationObjectCoalescing::IsSharedMemoryWriteOperation(const llvm::Instruction* pInst)
26332602
{
2634-
if (llvm::Type* pPtrType = GetWriteOperationPointerType(pInst))
2603+
if (llvm::isa<llvm::StoreInst>(pInst))
26352604
{
2636-
return IsSharedMemoryResource(pPtrType);
2605+
return IsSharedMemoryResource(llvm::cast<llvm::StoreInst>(pInst)->getPointerOperandType());
26372606
}
2607+
26382608
return false;
26392609
}
26402610

0 commit comments

Comments
 (0)