From e3e0132743ada1569cefe18bfbf54178330204c4 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 5 May 2022 09:09:25 -0400 Subject: Preliminary Liveness tracking (#2218) * #include an absolute path didn't work - because paths were taken to always be relative. * WIP tracking liveness. * Skeleton around adding liveness instructions. * Calling into liveness tracking logic. Adds live start to var insts. * Liveness macros have initial output. * Looking at different initialization scenarios. * Some discussion around liveness. * WIP for working out liveness end. * WIP Updated liveness using use lists. * Is now adding liveness information * Some small fixes. * WIP around liveness. * Seems to output liveness correctly for current scenario. * Tidy up liveness code. * Update comment arounds liveness to current status. * Small fixes to liveness test. * Add support for call in liveness analysis. * Improve liveness example with array access. * Small updates to comments. * Disable liveness test because inconsistencies with output on CI system. * Fix some issues brought up in PR. * Rename liveness instructions. --- source/slang/slang-ir.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index b53c247c3..782f259ee 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -2890,6 +2890,36 @@ namespace Slang return inst; } + IRLiveRangeStart* IRBuilder::emitLiveRangeStart(IRInst* referenced) + { + // This instruction doesn't produce any result, + // so we make it's type void. + auto inst = createInst( + this, + kIROp_LiveRangeStart, + getVoidType(), + referenced); + + addInst(inst); + + return inst; + } + + IRLiveRangeEnd* IRBuilder::emitLiveRangeEnd(IRInst* referenced) + { + // This instruction doesn't produce any result, + // so we make it's type void. + auto inst = createInst( + this, + kIROp_LiveRangeEnd, + getVoidType(), + referenced); + + addInst(inst); + + return inst; + } + IRInst* IRBuilder::emitExtractExistentialValue( IRType* type, IRInst* existentialValue) -- cgit v1.2.3