1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +00:00

JSSpecCompiler: Add bare-bones DCE pass

Right now the only dead code it eliminates is the unused phi nodes.
This commit is contained in:
Dan Klishch 2023-08-29 15:47:39 -04:00 committed by Andrew Kaster
parent 162c334508
commit 5338cdd153
6 changed files with 286 additions and 0 deletions

View file

@ -10,6 +10,7 @@
#include "Compiler/Passes/CFGBuildingPass.h"
#include "Compiler/Passes/CFGSimplificationPass.h"
#include "Compiler/Passes/DeadCodeEliminationPass.h"
#include "Compiler/Passes/FunctionCallCanonicalizationPass.h"
#include "Compiler/Passes/IfBranchMergingPass.h"
#include "Compiler/Passes/ReferenceResolvingPass.h"
@ -110,6 +111,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
pipeline.add_compilation_pass<CFGBuildingPass>();
pipeline.add_compilation_pass<CFGSimplificationPass>();
pipeline.add_compilation_pass<SSABuildingPass>();
pipeline.add_compilation_pass<DeadCodeEliminationPass>();
pipeline.for_each_step_in(passes_to_dump_ast, [](CompilationStepWithDumpOptions& step) {
step.dump_ast = true;