From 3cf1f5a616917480c63b76aae906dc36b29e46ce Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 9 Oct 2025 18:26:28 -0700 Subject: Small fix to buffer load specialization pass to allow more specialization to happen. (#8653) This allows us to further cleanup unnecessary copies in the target code we generate. Part of effort of #8652. --- source/slang/slang-ir-specialize-buffer-load-arg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/slang/slang-ir-specialize-buffer-load-arg.cpp') diff --git a/source/slang/slang-ir-specialize-buffer-load-arg.cpp b/source/slang/slang-ir-specialize-buffer-load-arg.cpp index a5a3dd2d9..c473c6047 100644 --- a/source/slang/slang-ir-specialize-buffer-load-arg.cpp +++ b/source/slang/slang-ir-specialize-buffer-load-arg.cpp @@ -89,7 +89,7 @@ struct FuncBufferLoadSpecializationCondition : FunctionCallSpecializeCondition a = argLoad->getPtr(); // We can safely defer a load to the callee if the source dest is immutable. - if (isPointerToImmutableLocation(a)) + if (isPointerToImmutableLocation(getRootAddr(a))) continue; // Otherwise, we check if there is no other instructions in between the load and the -- cgit v1.2.3