From 2a9948644eb33877cf30c717dbbcd6fae8fc3abb Mon Sep 17 00:00:00 2001 From: Krystian Andrzejewski Date: Fri, 6 Oct 2023 11:40:57 -0700 Subject: [PATCH] [Autobackout][FuncReg]Revert of change: c525925d2dfd2435394fdd9dabc0e6134c7d4308 Disallow assigning no mask flags for ld raw instructions This change is to prevent from assigning no mask flags for ld raw instructions which contribute to sample coordinates as it may cause OOB access and page faults. --- IGC/Compiler/CISACodeGen/EmitVISAPass.cpp | 29 ++++------------------- 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/IGC/Compiler/CISACodeGen/EmitVISAPass.cpp b/IGC/Compiler/CISACodeGen/EmitVISAPass.cpp index c8fb09c857e5..fd210609664c 100644 --- a/IGC/Compiler/CISACodeGen/EmitVISAPass.cpp +++ b/IGC/Compiler/CISACodeGen/EmitVISAPass.cpp @@ -269,30 +269,11 @@ bool EmitPass::IsNoMaskAllowed(SDAG& sdag) { if (auto* I = dyn_cast(sdag.m_root)) { - switch (I->getPointerAddressSpace()) - { - case ADDRESS_SPACE_PRIVATE: - case ADDRESS_SPACE_GLOBAL: - case ADDRESS_SPACE_CONSTANT: - return false; - default: - { - BufferType bufType = DecodeBufferType(I->getPointerAddressSpace()); - return bufType != CONSTANT_BUFFER || - !m_currShader->GetContext()->getModuleMetaData()->compOpt.WaDisableSubspanUseNoMaskForCB; - } - } - } - else if (auto* I = dyn_cast(sdag.m_root)) - { - switch (I->getIntrinsicID()) - { - case GenISAIntrinsic::GenISA_ldraw_indexed: - case GenISAIntrinsic::GenISA_ldrawvector_indexed: - return false; - default: - break; - } + BufferType bufType = DecodeBufferType(I->getPointerAddressSpace()); + return I->getPointerAddressSpace() != ADDRESS_SPACE_PRIVATE && + I->getPointerAddressSpace() != ADDRESS_SPACE_GLOBAL && + I->getPointerAddressSpace() != ADDRESS_SPACE_CONSTANT && + !(bufType == CONSTANT_BUFFER && m_currShader->GetContext()->getModuleMetaData()->compOpt.WaDisableSubspanUseNoMaskForCB); } return true;