[llvm] [DirectX] Add GlobalDCE pass after finalize linkage pass in DirectX backend (PR #151071)

Farzon Lotfi via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 6 14:20:57 PDT 2025


================
@@ -30,6 +32,36 @@ using namespace llvm;
 
 #define DEBUG_TYPE "globaldce"
 
+namespace {
+class GlobalDCELegacyPass : public ModulePass {
+public:
+  static char ID; // Pass identification, replacement for typeid
+  GlobalDCELegacyPass() : ModulePass(ID) {
+    initializeGlobalDCELegacyPassPass(*PassRegistry::getPassRegistry());
+  }
+  bool runOnModule(Module &M) override {
+    if (skipModule(M))
+      return false;
+    // Note: GlobalDCEPass does not use MAM. That
+    // means we can get away with init and pass
+    // as arg.
----------------
farzonl wrote:

This commit is mostly a revert of the commit that removed the legacy interface. Comment included. But agree your suggestion is much clearer.

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


More information about the llvm-commits mailing list