[llvm] [CodeGen] Port `SelectOptimize` to new pass manager (PR #74920)

via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 10 22:52:32 PST 2023


================
@@ -653,8 +655,11 @@ void CodeGenPassBuilder<Derived>::addIRPasses(AddIRPass &addPass) const {
   addPass(ExpandReductionsPass());
 
   // Convert conditional moves to conditional jumps when profitable.
-  if (getOptLevel() != CodeGenOptLevel::None && !Opt.DisableSelectOptimize)
-    addPass(SelectOptimizePass());
+  if (getOptLevel() != CodeGenOptLevel::None && !Opt.DisableSelectOptimize) {
+    // FIXME: this will trigger assertion!
+    addPass(RequireAnalysisPass<ProfileSummaryAnalysis, Module>());
----------------
paperchalice wrote:

This pass is a function pass and not the first function pass.
Currently `CodeGenPassBuilder` requires all module passes are added before function passes:
https://github.com/llvm/llvm-project/blob/ef112833e11e94ea049f98bec4a29b4fe96a25dd/llvm/include/llvm/CodeGen/CodeGenPassBuilder.h#L178-L186
Will add some explanation in this fixme.

https://github.com/llvm/llvm-project/pull/74920


More information about the llvm-commits mailing list