Skip to content

[NFC][LLVM][DirectX] Cleanup pass initialization for DirectX #134419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 8, 2025

Conversation

jurahul
Copy link
Contributor

@jurahul jurahul commented Apr 4, 2025

@jurahul jurahul requested review from bogner and hekota April 4, 2025 21:10
@jurahul jurahul marked this pull request as ready for review April 4, 2025 21:10
@llvmbot
Copy link
Member

llvmbot commented Apr 4, 2025

@llvm/pr-subscribers-backend-directx

Author: Rahul Joshi (jurahul)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/134419.diff

3 Files Affected:

  • (modified) llvm/lib/Target/DirectX/DXContainerGlobals.cpp (+1-3)
  • (modified) llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp (+1-6)
  • (modified) llvm/lib/Target/DirectX/DirectXTargetMachine.cpp (+1)
diff --git a/llvm/lib/Target/DirectX/DXContainerGlobals.cpp b/llvm/lib/Target/DirectX/DXContainerGlobals.cpp
index c7a130a1f9c8a..f5a78722558fe 100644
--- a/llvm/lib/Target/DirectX/DXContainerGlobals.cpp
+++ b/llvm/lib/Target/DirectX/DXContainerGlobals.cpp
@@ -51,9 +51,7 @@ class DXContainerGlobals : public llvm::ModulePass {
 
 public:
   static char ID; // Pass identification, replacement for typeid
-  DXContainerGlobals() : ModulePass(ID) {
-    initializeDXContainerGlobalsPass(*PassRegistry::getPassRegistry());
-  }
+  DXContainerGlobals() : ModulePass(ID) {}
 
   StringRef getPassName() const override {
     return "DXContainer Global Emitter";
diff --git a/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp b/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp
index 4d1832f44bb63..9c100ba9a9cbf 100644
--- a/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp
+++ b/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp
@@ -262,13 +262,8 @@ class DXILPrettyPrinterLegacy : public llvm::ModulePass {
 
 public:
   static char ID;
-  DXILPrettyPrinterLegacy() : ModulePass(ID), OS(dbgs()) {
-    initializeDXILPrettyPrinterLegacyPass(*PassRegistry::getPassRegistry());
-  }
 
-  explicit DXILPrettyPrinterLegacy(raw_ostream &O) : ModulePass(ID), OS(O) {
-    initializeDXILPrettyPrinterLegacyPass(*PassRegistry::getPassRegistry());
-  }
+  explicit DXILPrettyPrinterLegacy(raw_ostream &O) : ModulePass(ID), OS(O) {}
 
   StringRef getPassName() const override {
     return "DXIL Metadata Pretty Printer";
diff --git a/llvm/lib/Target/DirectX/DirectXTargetMachine.cpp b/llvm/lib/Target/DirectX/DirectXTargetMachine.cpp
index ce408b4034f83..747e4b3eb9411 100644
--- a/llvm/lib/Target/DirectX/DirectXTargetMachine.cpp
+++ b/llvm/lib/Target/DirectX/DirectXTargetMachine.cpp
@@ -64,6 +64,7 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeDirectXTarget() {
   initializeShaderFlagsAnalysisWrapperPass(*PR);
   initializeRootSignatureAnalysisWrapperPass(*PR);
   initializeDXILFinalizeLinkageLegacyPass(*PR);
+  initializeDXILPrettyPrinterLegacyPass(*PR);
 }
 
 class DXILTargetObjectFile : public TargetLoweringObjectFile {

@jurahul jurahul merged commit 7073676 into llvm:main Apr 8, 2025
15 checks passed
@jurahul jurahul deleted the cleanup_pass_init_dx branch April 8, 2025 00:28
@damyanp damyanp moved this to Closed in HLSL Support Apr 25, 2025
qiaojbao pushed a commit to GPUOpen-Drivers/llvm-project that referenced this pull request Apr 29, 2025
Local branch origin/amd-gfx 4cab0b6 Merged main:01bc672b8a41 into origin/amd-gfx:9191a26f4d41
Remote branch main 7073676 [NFC][LLVM][DirectX] Cleanup pass initialization for DirectX (llvm#134419)
@damyanp damyanp removed this from HLSL Support Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants