================ @@ -1306,6 +1306,10 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level, } // Cleanup after the loop optimization passes. FPM.addPass(InstCombinePass()); + // InstCombine can create CSE opportunities when it cleans the result of loop + // vectorization. They occur when combines use replaceOperand, which happens + // most often when combining the boolean operations created by if-conversion. + FPM.addPass(EarlyCSEPass()); if (Level.getSpeedupLevel() > 1 && ExtraVectorizerPasses) { ExtraFunctionPassManager<ShouldRunExtraVectorPasses> ExtraPasses; ---------------- paulwalker-arm wrote:
Thanks @fhahn. For my education is `ShouldRunExtraVectorPasses` something LoopVectorize "sets" to highlight the potential need for extra optimisations? https://github.com/llvm/llvm-project/pull/120443 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits