From 8b05df4187117d61491f2fdbeb7d744146ad73f7 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 20 Feb 2023 10:17:00 -0800 Subject: Add static for loop iteration inference. (#2659) --- source/slang/slang-ir-util.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'source/slang/slang-ir-util.cpp') 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()); -- cgit v1.2.3