<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/60852>60852</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Polly still uses legacy passes in polly/lib/CodeGen/CodegenCleanup.cpp
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            polly
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          fhahn
      </td>
    </tr>
</table>

<pre>
    The passes below are used. Should this block removal of deprecated legacy passes? For example, see https://reviews.llvm.org/D144201 which removes the legacy implementation of SCCP, but this breaks the polly build

```
    FPM = new llvm::legacy::FunctionPassManager(&M);

    // TODO: How to make parent passes discoverable?
    // TODO: Should be sensitive to compiler options in PassManagerBuilder, to
    // which we do not have access here.
    FPM->add(createScopedNoAliasAAWrapperPass());
 FPM->add(createTypeBasedAAWrapperPass());
 FPM->add(createAAResultsWrapperPass());

    // TODO: These are non-conditional passes that run between
    // EP_ModuleOptimizerEarly and EP_VectorizerStart just to ensure we do not
    // miss any optimization that would have run after Polly with
    // -polly-position=early. This can probably be reduced to a more compact set
    // of passes.
 FPM->add(createCFGSimplificationPass());
 FPM->add(createSROAPass());
    FPM->add(createEarlyCSEPass());

 FPM->add(createPromoteMemoryToRegisterPass());
 FPM->add(createInstructionCombiningPass(true));
 FPM->add(createCFGSimplificationPass());
 FPM->add(createSROAPass());
    FPM->add(createEarlyCSEPass(true));
 FPM->add(createSpeculativeExecutionIfHasBranchDivergencePass());
 FPM->add(createJumpThreadingPass());
 FPM->add(createCorrelatedValuePropagationPass());
 FPM->add(createCFGSimplificationPass());
 FPM->add(createInstructionCombiningPass(true));
 FPM->add(createLibCallsShrinkWrapPass());
 FPM->add(createTailCallEliminationPass());
 FPM->add(createCFGSimplificationPass());
 FPM->add(createReassociatePass());
 FPM->add(createLoopRotatePass(-1));
    FPM->add(createGVNPass());
 FPM->add(createLICMPass());
 FPM->add(createSimpleLoopUnswitchLegacyPass());
 FPM->add(createCFGSimplificationPass());
 FPM->add(createInstructionCombiningPass(true));
 FPM->add(createIndVarSimplifyPass());
 FPM->add(createLoopIdiomPass());
 FPM->add(createCFGSimplificationPass());
 FPM->add(createSimpleLoopUnrollPass(3));
 FPM->add(createMergedLoadStoreMotionPass());
 FPM->add(createGVNPass());
    FPM->add(createMemCpyOptPass());
 FPM->add(createSCCPPass());
    FPM->add(createBitTrackingDCEPass());
 FPM->add(createInstructionCombiningPass(true));
 FPM->add(createJumpThreadingPass());
 FPM->add(createCorrelatedValuePropagationPass());
 FPM->add(createDeadStoreEliminationPass());
 FPM->add(createLICMPass());
    FPM->add(createAggressiveDCEPass());
 FPM->add(createCFGSimplificationPass());
 FPM->add(createInstructionCombiningPass(true));
 FPM->add(createFloat2IntPass());
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUV1Fv2koT_TXmZQQyayDwwAMxcZtPoUGBL_fxarw72Nusd63dNZT--qs1pEmVUEGr2-pKUeKA58yZM2fWHnROFppoGg2vo-G8g40vjZ1uSix1JzdiP12XBDU6Rw5yUmYHaAkaR6IHq9I0SoAvpYNcGf4EliqzRQVmA4JqSxw9CVBUIN8fUaIkg8xYoC9Y1YoiloIjgtL72kXJLGJZxDJLW0k711NqW_WMLSKWzfuDAYv7sCslLw-JyIEv6RleBriKtEcvjQ4UVmm6DPh5448kLeHTIag2Su0hb6QSUTyP4tnx9yg-_rT_AgBkywVEyRw07SDwCSST2SHp4TprNA85l-jcAjUWZCM2jthoEbFJlFy_ThAQDzXC-n5-HyUz-Gh24A1U-BSUtqT9s-BCOm62ZDFXFCXZSYRjI3ICR9pJL7cUELmpaqnIgqkDPQdSwyuO16H4QDUFb95gH3TeEQgD2ngocUuAnJNzUJKl3ncKdaPkBoWI2JhbQk8rbmoSn8xMSXSz2V8W65psSN4qM3ktzHvx631N1-hI_ETsbPZArlHe_TDypJjrkhy1LtdGd7nRQgb1UD13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