diff options
| author | Yong He <yonghe@outlook.com> | 2023-02-20 14:42:50 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-20 14:42:50 -0800 |
| commit | 47715e625337d489f3c0131bbc2b849378b48a5a (patch) | |
| tree | bc737c8f03ef537b2ac39860bbb922c7600edc43 /source/slang/slang-ir.cpp | |
| parent | 8b05df4187117d61491f2fdbeb7d744146ad73f7 (diff) | |
Miscellaneous backward autodiff fixes. (#2665)
* Fix differentiable type registration
* Fix use of non-differentiable return value in a differentiable func.
* Fix use of primal inst that does not dominate the diff block.
* Fix primal inst hoisting, and add missing type legalization logic.
* Make `detach` defined on all differentiable T.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir.cpp')
| -rw-r--r-- | source/slang/slang-ir.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index dc61a45af..accefc0c9 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -5662,9 +5662,9 @@ namespace Slang #if SLANG_ENABLE_IR_BREAK_ALLOC if (context->options.flags & IRDumpOptions::Flag::DumpDebugIds) { - dump(context, "[#"); + dump(context, "{"); dump(context, String(inst->_debugUID)); - dump(context, "]"); + dump(context, "}\t"); } #else SLANG_UNUSED(context); @@ -5691,7 +5691,6 @@ namespace Slang { dump(context, "_"); } - dumpDebugID(context, inst); } static void dumpEncodeString( @@ -5819,6 +5818,7 @@ namespace Slang IRBlock* block) { context->indent--; + dumpDebugID(context, block); dump(context, "block "); dumpID(context, block); @@ -6050,7 +6050,6 @@ namespace Slang } dump(context, opInfo.name); - dumpDebugID(context, inst); dumpInstOperandList(context, inst); } @@ -6068,6 +6067,8 @@ namespace Slang dumpIRDecorations(context, inst); + dumpDebugID(context, inst); + // There are several ops we want to special-case here, // so that they will be more pleasant to look at. // @@ -6204,7 +6205,10 @@ namespace Slang context.options = options; context.sourceManager = sourceManager; - dumpInst(&context, globalVal); + if (globalVal->getOp() == kIROp_Module) + dumpIRModule(&context, globalVal->getModule()); + else + dumpInst(&context, globalVal); writer->write(sb.getBuffer(), sb.getLength()); writer->flush(); |
