From f545ef30052de7b4cab389cb58ffb0ea67ffb32c Mon Sep 17 00:00:00 2001 From: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> Date: Tue, 16 Jul 2024 18:21:51 -0400 Subject: Fix minimal-optimization flag with texture atomics (#4660) Co-authored-by: Yong He --- source/slang/slang-ir-legalize-is-texture-access.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/slang/slang-ir-legalize-is-texture-access.cpp b/source/slang/slang-ir-legalize-is-texture-access.cpp index a3540e3f2..b9a0a7772 100644 --- a/source/slang/slang-ir-legalize-is-texture-access.cpp +++ b/source/slang/slang-ir-legalize-is-texture-access.cpp @@ -39,11 +39,9 @@ namespace Slang if (getTextureAccess(inst)) inst->replaceUsesWith(builder.getBoolValue(true)); else - { inst->replaceUsesWith(builder.getBoolValue(false)); - functionsToSCCP.add(func); - } inst->removeAndDeallocate(); + functionsToSCCP.add(func); continue; case kIROp_IsTextureArrayAccess: { @@ -51,11 +49,9 @@ namespace Slang if (textureAccess && as(textureAccess->getImage()->getDataType())->isArray()) inst->replaceUsesWith(builder.getBoolValue(true)); else - { inst->replaceUsesWith(builder.getBoolValue(false)); - functionsToSCCP.add(func); - } inst->removeAndDeallocate(); + functionsToSCCP.add(func); continue; } case kIROp_IsTextureScalarAccess: @@ -64,11 +60,9 @@ namespace Slang if (textureAccess && !as(as(textureAccess->getImage()->getDataType())->getElementType())) inst->replaceUsesWith(builder.getBoolValue(true)); else - { inst->replaceUsesWith(builder.getBoolValue(false)); - functionsToSCCP.add(func); - } inst->removeAndDeallocate(); + functionsToSCCP.add(func); continue; } } @@ -79,7 +73,7 @@ namespace Slang // and unresolved 'isTextureAccess' operations for when 'inst' is not a // 'IRTextureType'/`TextureAccessor` for (auto func : functionsToSCCP) - applySparseConditionalConstantPropagation(func, sink); + applySparseConditionalConstantPropagation(func, sink); } } -- cgit v1.2.3