Skip to content

Commit

Permalink
Changes in code.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmerecki authored and igcbot committed Dec 18, 2024
1 parent 40f7d92 commit 9e57541
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 30 deletions.
12 changes: 2 additions & 10 deletions IGC/Compiler/CISACodeGen/CheckInstrTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,7 @@ void CheckInstrTypes::visitCallInst(CallInst& C)
g_InstrTypes.num1DAccesses++;
BufferType bufferType = DecodeBufferType(
CI->getArgOperand(0)->getType()->getPointerAddressSpace());
if (bufferType == UAV ||
bufferType == BINDLESS ||
bufferType == BINDLESS_READONLY)
if (bufferType == UAV || bufferType == BINDLESS)
{
g_InstrTypes.hasStorageBufferLoad = true;
}
Expand All @@ -382,9 +380,7 @@ void CheckInstrTypes::visitCallInst(CallInst& C)
g_InstrTypes.num1DAccesses++;
BufferType bufferType = DecodeBufferType(
CI->getArgOperand(0)->getType()->getPointerAddressSpace());
if (bufferType == UAV ||
bufferType == BINDLESS ||
bufferType == BINDLESS_WRITEONLY)
if (bufferType == UAV || bufferType == BINDLESS)
{
g_InstrTypes.hasStorageBufferStore = true;
}
Expand Down Expand Up @@ -568,7 +564,6 @@ void CheckInstrTypes::visitLoadInst(LoadInst& I)
g_InstrTypes.num1DAccesses++;
break;
case IGC::BINDLESS:
case IGC::BINDLESS_READONLY:
case IGC::SSH_BINDLESS:
g_InstrTypes.hasStorageBufferLoad = true;
break;
Expand All @@ -588,7 +583,6 @@ void CheckInstrTypes::visitLoadInst(LoadInst& I)
case IGC::CONSTANT_BUFFER:
case IGC::POINTER:
case IGC::BINDLESS_CONSTANT_BUFFER:
case IGC::BINDLESS_WRITEONLY:
case IGC::BINDLESS_TEXTURE:
case IGC::SAMPLER:
case IGC::BINDLESS_SAMPLER:
Expand Down Expand Up @@ -643,7 +637,6 @@ void CheckInstrTypes::visitStoreInst(StoreInst& I)
g_InstrTypes.num1DAccesses++;
break;
case IGC::BINDLESS:
case IGC::BINDLESS_WRITEONLY:
case IGC::SSH_BINDLESS:
g_InstrTypes.hasStorageBufferStore = true;
break;
Expand All @@ -663,7 +656,6 @@ void CheckInstrTypes::visitStoreInst(StoreInst& I)
case IGC::CONSTANT_BUFFER:
case IGC::POINTER:
case IGC::BINDLESS_CONSTANT_BUFFER:
case IGC::BINDLESS_READONLY:
case IGC::BINDLESS_TEXTURE:
case IGC::SAMPLER:
case IGC::BINDLESS_SAMPLER:
Expand Down
4 changes: 1 addition & 3 deletions IGC/Compiler/CISACodeGen/helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,14 +629,13 @@ namespace IGC

BufferAccessType getDefaultAccessType(BufferType bufTy)
{
static_assert(BufferType::BUFFER_TYPE_UNKNOWN == 19, "Please also update switch() below");
static_assert(BufferType::BUFFER_TYPE_UNKNOWN == 17, "Please also update switch() below");
switch (bufTy)
{
case BufferType::CONSTANT_BUFFER:
case BufferType::RESOURCE:
case BufferType::BINDLESS_TEXTURE:
case BufferType::BINDLESS_CONSTANT_BUFFER:
case BufferType::BINDLESS_READONLY:
case BufferType::STATELESS_READONLY:
case BufferType::SAMPLER:
case BufferType::BINDLESS_SAMPLER:
Expand All @@ -653,7 +652,6 @@ namespace IGC
case BufferType::STATELESS_A32:
return BufferAccessType::ACCESS_READWRITE;

case BufferType::BINDLESS_WRITEONLY:
case BufferType::RENDER_TARGET:
return BufferAccessType::ACCESS_WRITE;
default:
Expand Down
4 changes: 0 additions & 4 deletions IGC/Compiler/CISACodeGen/helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@ namespace IGC
{
return t == BINDLESS ||
t == BINDLESS_CONSTANT_BUFFER ||
t == BINDLESS_READONLY ||
t == BINDLESS_WRITEONLY ||
t == BINDLESS_TEXTURE;
}
inline bool IsSSHbindless(BufferType t)
Expand All @@ -263,8 +261,6 @@ namespace IGC
t == CONSTANT_BUFFER ||
t == BINDLESS ||
t == BINDLESS_CONSTANT_BUFFER ||
t == BINDLESS_READONLY ||
t == BINDLESS_WRITEONLY ||
t == SSH_BINDLESS ||
t == SSH_BINDLESS_CONSTANT_BUFFER;
}
Expand Down
2 changes: 0 additions & 2 deletions IGC/Compiler/CodeGenPublicEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ namespace IGC
SSH_BINDLESS,
SSH_BINDLESS_CONSTANT_BUFFER,
SSH_BINDLESS_TEXTURE,
BINDLESS_READONLY,
BINDLESS_WRITEONLY,
BUFFER_TYPE_UNKNOWN
};

Expand Down
17 changes: 6 additions & 11 deletions IGC/Compiler/Optimizer/SynchronizationObjectCoalescing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ class SynchronizationObjectCoalescing : public llvm::FunctionPass
static bool IsFenceOperation(const llvm::Instruction* pInst);

////////////////////////////////////////////////////////////////////////
static bool IsGlobalWritableResource(llvm::Type* pResourePointerType);
static bool IsGlobalResource(llvm::Type* pResourePointerType);

////////////////////////////////////////////////////////////////////////
static bool IsSharedMemoryResource(llvm::Type* pResourePointerType);
Expand Down Expand Up @@ -1865,7 +1865,7 @@ IGC::InstructionMask SynchronizationObjectCoalescing::GetAtomicInstructionMaskFr
else
{
llvm::Type* pPointerType = pGenIntrinsicInst->getOperand(0)->getType();
if (IsGlobalWritableResource(pPointerType))
if (IsGlobalResource(pPointerType))
{
result = static_cast<InstructionMask>(result | InstructionMask::BufferReadOperation);
result = static_cast<InstructionMask>(result | InstructionMask::BufferWriteOperation);
Expand Down Expand Up @@ -2466,7 +2466,7 @@ bool SynchronizationObjectCoalescing::IsTypedReadOperation(const llvm::Instructi
switch (pGenIntrinsicInst->getIntrinsicID())
{
case llvm::GenISAIntrinsic::GenISA_typedread:
return IsGlobalWritableResource(pGenIntrinsicInst->getOperand(0)->getType());
return true;
default:
break;
}
Expand Down Expand Up @@ -2603,7 +2603,7 @@ bool SynchronizationObjectCoalescing::IsBufferReadOperation(const llvm::Instruct
{
if (llvm::Type* pPtrType = GetReadOperationPointerType(pInst))
{
return IsGlobalWritableResource(pPtrType);
return IsGlobalResource(pPtrType);
}
return false;
}
Expand All @@ -2613,7 +2613,7 @@ bool SynchronizationObjectCoalescing::IsBufferWriteOperation(const llvm::Instruc
{
if (llvm::Type* pPtrType = GetWriteOperationPointerType(pInst))
{
return IsGlobalWritableResource(pPtrType);
return IsGlobalResource(pPtrType);
}
return false;
}
Expand Down Expand Up @@ -2920,10 +2920,7 @@ bool SynchronizationObjectCoalescing::IsFenceOperation(const llvm::Instruction*
}

////////////////////////////////////////////////////////////////////////
/// Returns true for resources in the global memory (storage buffers or
/// storage images) that are not marked as ReadOnly in the shader.
bool SynchronizationObjectCoalescing::IsGlobalWritableResource(
llvm::Type* pResourePointerType)
bool SynchronizationObjectCoalescing::IsGlobalResource(llvm::Type* pResourePointerType)
{
uint as = pResourePointerType->getPointerAddressSpace();
switch (as)
Expand All @@ -2940,7 +2937,6 @@ bool SynchronizationObjectCoalescing::IsGlobalWritableResource(
{
case IGC::UAV:
case IGC::BINDLESS:
case IGC::BINDLESS_WRITEONLY:
case IGC::STATELESS:
case IGC::SSH_BINDLESS:
return true;
Expand All @@ -2950,7 +2946,6 @@ bool SynchronizationObjectCoalescing::IsGlobalWritableResource(
case IGC::POINTER:
case IGC::BINDLESS_CONSTANT_BUFFER:
case IGC::BINDLESS_TEXTURE:
case IGC::BINDLESS_READONLY:
case IGC::SAMPLER:
case IGC::BINDLESS_SAMPLER:
case IGC::RENDER_TARGET:
Expand Down

0 comments on commit 9e57541

Please sign in to comment.