summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-util.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-04-27 14:30:36 -0700
committerGitHub <noreply@github.com>2023-04-27 14:30:36 -0700
commitd1cc6a8c1e5b378ea34dc4006045bcbd37e0dfd3 (patch)
tree6c4771a8bc91414b38e77c7ef79e5151c66d23b1 /source/slang/slang-ir-util.cpp
parent7be108c379ccc7da3f46b30a2b5917104155d52b (diff)
Prevent storing loads of global parameters. (#2850)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-util.cpp')
-rw-r--r--source/slang/slang-ir-util.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp
index 05d3157a7..a69e13562 100644
--- a/source/slang/slang-ir-util.cpp
+++ b/source/slang/slang-ir-util.cpp
@@ -354,7 +354,7 @@ void getTypeNameHint(StringBuilder& sb, IRInst* type)
}
}
-static IRInst* _getRootAddr(IRInst* addr)
+IRInst* getRootAddr(IRInst* addr)
{
for (;;)
{
@@ -379,8 +379,8 @@ bool canAddressesPotentiallyAlias(IRGlobalValueWithCode* func, IRInst* addr1, IR
return true;
// Two variables can never alias.
- addr1 = _getRootAddr(addr1);
- addr2 = _getRootAddr(addr2);
+ addr1 = getRootAddr(addr1);
+ addr2 = getRootAddr(addr2);
// Global addresses can alias with anything.
if (!isChildInstOf(addr1, func))
@@ -436,7 +436,7 @@ bool canInstHaveSideEffectAtAddress(IRGlobalValueWithCode* func, IRInst* inst, I
// If addr is a global variable, calling a function may change its value.
// So we need to return true here to be conservative.
- if (!isChildInstOf(_getRootAddr(addr), func))
+ if (!isChildInstOf(getRootAddr(addr), func))
{
auto callee = call->getCallee();
if (callee &&