summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-ssa.cpp
diff options
context:
space:
mode:
authorSai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com>2023-02-17 12:03:59 -0500
committerGitHub <noreply@github.com>2023-02-17 09:03:59 -0800
commitf253d15a3b2681dfa40491451fcb3f21f1dbe412 (patch)
tree589298ff23ea2b2eb89615694f2c06613f1199a1 /source/slang/slang-ir-ssa.cpp
parent245466d89cfe54b78da486f06d470bc6daaf4625 (diff)
Proper reverse-mode loop handling with splitting + inversion steps (#2656)
* Halfway to loop inversion * More progress towards proper loop inversion * More progress towards inverse insts. Only thing left is adding `counter>=0` at the right place * More fixes for inversion step. * Lots more fixes, added primal inst 'hoisting' mechanism as the central method that ensures primal values are placed in the right spot * Loop inversion is now functional * Cleaned up commented code * rename diffCounterVar -> diffCounterParam * minor update * removed some comments and commented code * Switch `IRBuilder(sharedIRBuilder)` to `IRBuilder(moduleInst)`
Diffstat (limited to 'source/slang/slang-ir-ssa.cpp')
-rw-r--r--source/slang/slang-ir-ssa.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/slang/slang-ir-ssa.cpp b/source/slang/slang-ir-ssa.cpp
index d8246edae..20a8d7d13 100644
--- a/source/slang/slang-ir-ssa.cpp
+++ b/source/slang/slang-ir-ssa.cpp
@@ -1056,7 +1056,10 @@ bool constructSSA(ConstructSSAContext* context)
// Figure out what variables we can promote to
// SSA temporaries.
- identifyPromotableVars(context);
+ if (!(context->promotableVars.getCount() > 0))
+ {
+ identifyPromotableVars(context);
+ }
// If none of the variables are promote-able,
// then we can exit without making any changes