[llvm] [CGData] Global Merge Functions (PR #112671)

Vincent Lee via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 10 22:36:04 PST 2024


================
@@ -0,0 +1,732 @@
+//===---- GlobalMergeFunctions.cpp - Global merge functions -------*- C++ -===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This pass implements the global merge function pass.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/CodeGen/GlobalMergeFunctions.h"
+#include "llvm/ADT/Statistic.h"
+#include "llvm/Analysis/ModuleSummaryAnalysis.h"
+#include "llvm/CGData/CodeGenData.h"
+#include "llvm/IR/IRBuilder.h"
+#include "llvm/IR/StructuralHash.h"
+#include "llvm/InitializePasses.h"
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Transforms/Utils/ModuleUtils.h"
+
+#define DEBUG_TYPE "global-merge-func"
+
+using namespace llvm;
+using namespace llvm::support;
+
+static cl::opt<bool>
+    DisableGlobalMerging("disable-global-merging", cl::Hidden,
----------------
thevinster wrote:

Would the name here be confusing? i.e. Readers might be assume the functionality is no-op when passing both `-enable-global-merge-func` and `disable-global-merging`. Perhaps something like `-disable-codegen-data`? 

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


More information about the llvm-commits mailing list