[llvm] [CodeGen] Port GlobalMerge to new pass manager (PR #77474)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 10 00:36:01 PST 2024


================
@@ -290,6 +291,9 @@ template <typename DerivedT> class CodeGenPassBuilder {
                                    inconvertibleErrorCode());
   }
 
+  /// Target can override this to add GlobalMergePass before all IR passes.
+  void addGlobalMergePass(AddIRPass &) const {}
----------------
paperchalice wrote:

> Something doesn't make sense. Why is this a function pass, that only changes the module and does all the work in doInitalization? Should it be converted to a ModulePass?

Unfortunately, `GlobalMerge` must run before the `doInitialization` of `AsmPrinter` to keep the dwaf info.



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


More information about the llvm-commits mailing list