diff --git a/IGC/Compiler/CISACodeGen/CheckInstrTypes.cpp b/IGC/Compiler/CISACodeGen/CheckInstrTypes.cpp index 4b2736161ce1..bc8eddbbd44c 100644 --- a/IGC/Compiler/CISACodeGen/CheckInstrTypes.cpp +++ b/IGC/Compiler/CISACodeGen/CheckInstrTypes.cpp @@ -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; } @@ -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; } @@ -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; @@ -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: @@ -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; @@ -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: diff --git a/IGC/Compiler/CISACodeGen/helper.cpp b/IGC/Compiler/CISACodeGen/helper.cpp index 997be43e2349..6e66af164f1e 100644 --- a/IGC/Compiler/CISACodeGen/helper.cpp +++ b/IGC/Compiler/CISACodeGen/helper.cpp @@ -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: @@ -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: diff --git a/IGC/Compiler/CISACodeGen/helper.h b/IGC/Compiler/CISACodeGen/helper.h index 8beb0205c196..16d8b4632915 100644 --- a/IGC/Compiler/CISACodeGen/helper.h +++ b/IGC/Compiler/CISACodeGen/helper.h @@ -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) @@ -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; } diff --git a/IGC/Compiler/CodeGenPublicEnums.h b/IGC/Compiler/CodeGenPublicEnums.h index 7ee964d923c9..7cb957739b17 100644 --- a/IGC/Compiler/CodeGenPublicEnums.h +++ b/IGC/Compiler/CodeGenPublicEnums.h @@ -96,8 +96,6 @@ namespace IGC SSH_BINDLESS, SSH_BINDLESS_CONSTANT_BUFFER, SSH_BINDLESS_TEXTURE, - BINDLESS_READONLY, - BINDLESS_WRITEONLY, BUFFER_TYPE_UNKNOWN }; diff --git a/IGC/Compiler/Optimizer/SynchronizationObjectCoalescing.cpp b/IGC/Compiler/Optimizer/SynchronizationObjectCoalescing.cpp index be945b9fe94b..1fa6e57a6fdd 100644 --- a/IGC/Compiler/Optimizer/SynchronizationObjectCoalescing.cpp +++ b/IGC/Compiler/Optimizer/SynchronizationObjectCoalescing.cpp @@ -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); @@ -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(result | InstructionMask::BufferReadOperation); result = static_cast(result | InstructionMask::BufferWriteOperation); @@ -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; } @@ -2603,7 +2603,7 @@ bool SynchronizationObjectCoalescing::IsBufferReadOperation(const llvm::Instruct { if (llvm::Type* pPtrType = GetReadOperationPointerType(pInst)) { - return IsGlobalWritableResource(pPtrType); + return IsGlobalResource(pPtrType); } return false; } @@ -2613,7 +2613,7 @@ bool SynchronizationObjectCoalescing::IsBufferWriteOperation(const llvm::Instruc { if (llvm::Type* pPtrType = GetWriteOperationPointerType(pInst)) { - return IsGlobalWritableResource(pPtrType); + return IsGlobalResource(pPtrType); } return false; } @@ -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) @@ -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; @@ -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: