summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-util.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-02-20 10:17:00 -0800
committerGitHub <noreply@github.com>2023-02-20 10:17:00 -0800
commit8b05df4187117d61491f2fdbeb7d744146ad73f7 (patch)
treecfb17b26e9db313d0b6ce1a07efe85b35d6d1638 /source/slang/slang-ir-util.cpp
parenta8da735ca4e0ed49796dda164c39e21aea4a7bc6 (diff)
Add static for loop iteration inference. (#2659)
Diffstat (limited to 'source/slang/slang-ir-util.cpp')
-rw-r--r--source/slang/slang-ir-util.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp
index 253686aa5..f3c4c2c82 100644
--- a/source/slang/slang-ir-util.cpp
+++ b/source/slang/slang-ir-util.cpp
@@ -466,6 +466,27 @@ IRInst* getUndefInst(IRBuilder builder, IRModule* module)
return undefInst;
}
+IROp getSwapSideComparisonOp(IROp op)
+{
+ switch (op)
+ {
+ case kIROp_Eql:
+ return kIROp_Eql;
+ case kIROp_Neq:
+ return kIROp_Neq;
+ case kIROp_Leq:
+ return kIROp_Geq;
+ case kIROp_Geq:
+ return kIROp_Leq;
+ case kIROp_Less:
+ return kIROp_Greater;
+ case kIROp_Greater:
+ return kIROp_Less;
+ default:
+ return kIROp_Nop;
+ }
+}
+
bool isPureFunctionalCall(IRCall* call)
{
auto callee = getResolvedInstForDecorations(call->getCallee());