From 8cb0aec724230f3c8d9a8958f761d10552efc111 Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Fri, 12 Jan 2018 15:15:57 -0500 Subject: [PATCH] Remove redundant passes from legalization passes With work that Alan has done, some passes have become redundant. ADCE now removed unused variables. Dead branch elimination removes unreachable blocks. This means we can remove CFG Cleanup and dead variable elimination. --- source/opt/optimizer.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/source/opt/optimizer.cpp b/source/opt/optimizer.cpp index 1f60356cf..b85a8d8aa 100644 --- a/source/opt/optimizer.cpp +++ b/source/opt/optimizer.cpp @@ -107,11 +107,8 @@ Optimizer& Optimizer::RegisterLegalizationPasses() { // May need loop unrolling here see // https://github.com/Microsoft/DirectXShaderCompiler/pull/930 .RegisterPass(CreateDeadBranchElimPass()) - .RegisterPass(CreateCFGCleanupPass()) // Get rid of unused code that leave traces of the illegal code. - .RegisterPass(CreateAggressiveDCEPass()) - // TODO: Remove this once ADCE can do it. - .RegisterPass(CreateDeadVariableEliminationPass()); + .RegisterPass(CreateAggressiveDCEPass()); } Optimizer& Optimizer::RegisterPerformancePasses() {