[llvm] [NVPTX] Move a few NewPM pass classes to Required (PR #216595)

via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 16 12:27:15 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-nvptx

Author: Alex MacLean (AlexMaclean)

<details>
<summary>Changes</summary>



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


4 Files Affected:

- (modified) llvm/lib/Target/NVPTX/NVPTX.h (+9-3) 
- (modified) llvm/lib/Target/NVPTX/NVPTXCtorDtorLowering.cpp (+1-2) 
- (removed) llvm/lib/Target/NVPTX/NVPTXCtorDtorLowering.h (-27) 
- (modified) llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp (-1) 


``````````diff
diff --git a/llvm/lib/Target/NVPTX/NVPTX.h b/llvm/lib/Target/NVPTX/NVPTX.h
index 966c629e5892c..f8fd0fea2a2a0 100644
--- a/llvm/lib/Target/NVPTX/NVPTX.h
+++ b/llvm/lib/Target/NVPTX/NVPTX.h
@@ -93,7 +93,7 @@ void initializeNVPTXIRPeepholePass(PassRegistry &);
 void initializeNVPTXPrologEpilogLegacyPassPass(PassRegistry &);
 
 // Module passes
-class GenericToNVVMPass : public OptionalPassInfoMixin<GenericToNVVMPass> {
+class GenericToNVVMPass : public RequiredPassInfoMixin<GenericToNVVMPass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
 };
@@ -104,7 +104,13 @@ class NVPTXAssignValidGlobalNamesPass
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
 };
 
-class NVPTXLowerArgsPass : public OptionalPassInfoMixin<NVPTXLowerArgsPass> {
+class NVPTXCtorDtorLoweringPass
+    : public RequiredPassInfoMixin<NVPTXCtorDtorLoweringPass> {
+public:
+  PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
+};
+
+class NVPTXLowerArgsPass : public RequiredPassInfoMixin<NVPTXLowerArgsPass> {
   TargetMachine &TM;
 
 public:
@@ -118,7 +124,7 @@ class NVPTXPromoteParamAlignPass
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
 };
 
-class NVVMReflectPass : public OptionalPassInfoMixin<NVVMReflectPass> {
+class NVVMReflectPass : public RequiredPassInfoMixin<NVVMReflectPass> {
   unsigned SmVersion;
 
 public:
diff --git a/llvm/lib/Target/NVPTX/NVPTXCtorDtorLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXCtorDtorLowering.cpp
index fe9997e3df2b3..a9363e12c0b9c 100644
--- a/llvm/lib/Target/NVPTX/NVPTXCtorDtorLowering.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXCtorDtorLowering.cpp
@@ -10,7 +10,6 @@
 /// This pass creates a unified init and fini kernel with the required metadata
 //===----------------------------------------------------------------------===//
 
-#include "NVPTXCtorDtorLowering.h"
 #include "MCTargetDesc/NVPTXBaseInfo.h"
 #include "NVPTX.h"
 #include "llvm/ADT/StringExtras.h"
@@ -245,7 +244,7 @@ class NVPTXCtorDtorLoweringLegacy final : public ModulePass {
 } // End anonymous namespace
 
 PreservedAnalyses NVPTXCtorDtorLoweringPass::run(Module &M,
-                                                 ModuleAnalysisManager &AM) {
+                                                 ModuleAnalysisManager &MAM) {
   return lowerCtorsAndDtors(M) ? PreservedAnalyses::none()
                                : PreservedAnalyses::all();
 }
diff --git a/llvm/lib/Target/NVPTX/NVPTXCtorDtorLowering.h b/llvm/lib/Target/NVPTX/NVPTXCtorDtorLowering.h
deleted file mode 100644
index 29be3434721b8..0000000000000
--- a/llvm/lib/Target/NVPTX/NVPTXCtorDtorLowering.h
+++ /dev/null
@@ -1,27 +0,0 @@
-//===-- NVPTXCtorDtorLowering.h --------------------------------*- 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
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIB_TARGET_NVPTX_NVPTXCTORDTORLOWERING_H
-#define LLVM_LIB_TARGET_NVPTX_NVPTXCTORDTORLOWERING_H
-
-#include "llvm/IR/PassManager.h"
-
-namespace llvm {
-class Module;
-class PassRegistry;
-
-/// Lower llvm.global_ctors and llvm.global_dtors to special kernels.
-class NVPTXCtorDtorLoweringPass
-    : public OptionalPassInfoMixin<NVPTXCtorDtorLoweringPass> {
-public:
-  PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
-};
-
-} // namespace llvm
-
-#endif // LLVM_LIB_TARGET_NVPTX_NVPTXCTORDTORLOWERING_H
diff --git a/llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp b/llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
index bedeb9646424c..7b2c4a637e8b5 100644
--- a/llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
@@ -14,7 +14,6 @@
 #include "NVPTX.h"
 #include "NVPTXAliasAnalysis.h"
 #include "NVPTXAsmPrinter.h"
-#include "NVPTXCtorDtorLowering.h"
 #include "NVPTXMachineFunctionInfo.h"
 #include "NVPTXTargetObjectFile.h"
 #include "NVPTXTargetTransformInfo.h"

``````````

</details>


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


More information about the llvm-commits mailing list