summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-ssa-simplification.cpp
diff options
context:
space:
mode:
authorSai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com>2024-10-28 15:47:58 -0400
committerGitHub <noreply@github.com>2024-10-28 15:47:58 -0400
commitb61be5e6fb7fe1c4ec8228cdf73f49f11e5a0ac9 (patch)
tree0e392546b41a55d36a874f2a82110867e6dd422c /source/slang/slang-ir-ssa-simplification.cpp
parent0557a199d2eb205bf133c8fc111cce3a19336fde (diff)
Assorted auto-diff enhancements for increased performance & more streamlined auto-diff results (#5394)
* Various AD enhancements * Fix issue with pt-loop test * Update pt-loop.slang * More fixes for perf. Final minimal context test now passes. * Fix issue with loop-elimination pass not running after dce * Try fix wgpu test by removing select operator * Disable wgpu * Delete out.wgsl * Remove comments * Update slang-ir-util.cpp * Fix header relative paths for slang-embed * Disbale wgpu for a few other tests * Better way of determining which params to ignore for side-effects * Update slang-ir-dce.cpp * Fix issue with circular reference from previous AD pass being left behind for the next AD pass * Update slang-ir-dce.cpp
Diffstat (limited to 'source/slang/slang-ir-ssa-simplification.cpp')
-rw-r--r--source/slang/slang-ir-ssa-simplification.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/slang/slang-ir-ssa-simplification.cpp b/source/slang/slang-ir-ssa-simplification.cpp
index cd0f67186..a71b2c86c 100644
--- a/source/slang/slang-ir-ssa-simplification.cpp
+++ b/source/slang/slang-ir-ssa-simplification.cpp
@@ -64,6 +64,7 @@ namespace Slang
changed |= removeUnusedGenericParam(module);
changed |= applySparseConditionalConstantPropagationForGlobalScope(module, sink);
changed |= peepholeOptimizeGlobalScope(target, module);
+ changed |= trimOptimizableTypes(module);
for (auto inst : module->getGlobalInsts())
{
@@ -74,6 +75,8 @@ namespace Slang
int funcIterationCount = 0;
while (funcChanged && funcIterationCount < kMaxFuncIterations)
{
+
+ eliminateDeadCode(func, options.deadCodeElimOptions);
funcChanged = false;
funcChanged |= applySparseConditionalConstantPropagation(func, sink);
funcChanged |= peepholeOptimize(target, func);
@@ -83,6 +86,8 @@ namespace Slang
// Note: we disregard the `changed` state from dead code elimination pass since
// SCCP pass could be generating temporarily evaluated constant values and never actually use them.
// DCE will always remove those nearly generated consts and always returns true here.
+ // Run eliminate-dead-code twice to ensure optimizations are applied on the dce'd code.
+ //
eliminateDeadCode(func, options.deadCodeElimOptions);
if (funcIterationCount == 0)
funcChanged |= constructSSA(func);