One crucial part is still missing: we need to define the pass that performs the DAG transformations defined in the…