From 99c295477fa1f6c5ce47e0d1c8fb3eea9d5e5f98 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 7 Nov 2019 13:51:46 -0500 Subject: * Removed strip pass from emit as no longer needed (#1114) * If obfuscate is enabled do strip on Layout * Add option to keep insts that have layout decoration (else DCE strips layout) * Add NameHint back in lowering - as strip now correctly removes. We may want NameHints in some stages even with obfuscation (for error messages in IR passes), as long as they are removed appropriately at the end --- source/slang/slang-ir-dce.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/slang/slang-ir-dce.cpp') diff --git a/source/slang/slang-ir-dce.cpp b/source/slang/slang-ir-dce.cpp index 4359e7e92..7c1cda75f 100644 --- a/source/slang/slang-ir-dce.cpp +++ b/source/slang/slang-ir-dce.cpp @@ -256,6 +256,11 @@ struct DeadCodeEliminationContext } } + if (options.keepLayoutsAlive && inst->findDecoration()) + { + return true; + } + // A basic block is an interesting case. Knowing that a function // is live means that its entry block is live, but the liveness // of any other blocks is determined by whether they are referenced -- cgit v1.2.3