[llvm-branch-commits] [llvm] [RISCV][NFC] Move RISCVCodeGenPrepare Declarations (PR #215679)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Aug 11 14:57:26 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-risc-v
Author: Sam Elliott (lenary)
<details>
<summary>Changes</summary>
This change moves them into their own header, as has been done for the
other NewPM passes.
Assisted-by: AI
---
<sub>Stack created with <a href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
---
Full diff: https://github.com/llvm/llvm-project/pull/215679.diff
5 Files Affected:
- (modified) llvm/lib/Target/RISCV/RISCV.h (-12)
- (modified) llvm/lib/Target/RISCV/RISCVCodeGenPassBuilder.cpp (+1)
- (modified) llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp (+1-1)
- (added) llvm/lib/Target/RISCV/RISCVCodeGenPrepare.h (+40)
- (modified) llvm/lib/Target/RISCV/RISCVTargetMachine.cpp (+1)
``````````diff
diff --git a/llvm/lib/Target/RISCV/RISCV.h b/llvm/lib/Target/RISCV/RISCV.h
index e2cd888b8c5db..5d7b45e75e8a3 100644
--- a/llvm/lib/Target/RISCV/RISCV.h
+++ b/llvm/lib/Target/RISCV/RISCV.h
@@ -28,18 +28,6 @@ class RISCVRegisterBankInfo;
class RISCVSubtarget;
class RISCVTargetMachine;
-class RISCVCodeGenPreparePass
- : public OptionalPassInfoMixin<RISCVCodeGenPreparePass> {
-private:
- const RISCVTargetMachine *TM;
-
-public:
- RISCVCodeGenPreparePass(const RISCVTargetMachine *TM) : TM(TM) {}
- PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
-};
-FunctionPass *createRISCVCodeGenPrepareLegacyPass();
-void initializeRISCVCodeGenPrepareLegacyPassPass(PassRegistry &);
-
FunctionPass *createRISCVDeadRegisterDefinitionsPass();
void initializeRISCVDeadRegisterDefinitionsPass(PassRegistry &);
diff --git a/llvm/lib/Target/RISCV/RISCVCodeGenPassBuilder.cpp b/llvm/lib/Target/RISCV/RISCVCodeGenPassBuilder.cpp
index 10890e5e04206..56888653336be 100644
--- a/llvm/lib/Target/RISCV/RISCVCodeGenPassBuilder.cpp
+++ b/llvm/lib/Target/RISCV/RISCVCodeGenPassBuilder.cpp
@@ -11,6 +11,7 @@
#include "RISCV.h"
#include "RISCVAsmPrinter.h"
+#include "RISCVCodeGenPrepare.h"
#include "RISCVFoldMemOffset.h"
#include "RISCVGatherScatterLowering.h"
#include "RISCVOptWInstrs.h"
diff --git a/llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp b/llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp
index d5644ff00537a..3c84aaa732c36 100644
--- a/llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp
+++ b/llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp
@@ -13,7 +13,7 @@
//
//===----------------------------------------------------------------------===//
-#include "RISCV.h"
+#include "RISCVCodeGenPrepare.h"
#include "RISCVTargetMachine.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/ValueTracking.h"
diff --git a/llvm/lib/Target/RISCV/RISCVCodeGenPrepare.h b/llvm/lib/Target/RISCV/RISCVCodeGenPrepare.h
new file mode 100644
index 0000000000000..36dc6362beff1
--- /dev/null
+++ b/llvm/lib/Target/RISCV/RISCVCodeGenPrepare.h
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file declares the RISC-V CodeGen Prepare passes.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIB_TARGET_RISCV_RISCVCODEGENPREPARE_H
+#define LLVM_LIB_TARGET_RISCV_RISCVCODEGENPREPARE_H
+
+#include "llvm/IR/PassManager.h"
+
+namespace llvm {
+
+class FunctionPass;
+class PassRegistry;
+class RISCVTargetMachine;
+
+class RISCVCodeGenPreparePass
+ : public OptionalPassInfoMixin<RISCVCodeGenPreparePass> {
+private:
+ const RISCVTargetMachine *TM;
+
+public:
+ RISCVCodeGenPreparePass(const RISCVTargetMachine *TM) : TM(TM) {}
+ PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
+};
+
+FunctionPass *createRISCVCodeGenPrepareLegacyPass();
+void initializeRISCVCodeGenPrepareLegacyPassPass(PassRegistry &);
+
+} // namespace llvm
+
+#endif // LLVM_LIB_TARGET_RISCV_RISCVCODEGENPREPARE_H
diff --git a/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp b/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
index 5e633fae1ff8a..4f01bbc63c64d 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
+++ b/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
@@ -13,6 +13,7 @@
#include "RISCVTargetMachine.h"
#include "MCTargetDesc/RISCVBaseInfo.h"
#include "RISCV.h"
+#include "RISCVCodeGenPrepare.h"
#include "RISCVFoldMemOffset.h"
#include "RISCVGatherScatterLowering.h"
#include "RISCVMachineFunctionInfo.h"
``````````
</details>
https://github.com/llvm/llvm-project/pull/215679
More information about the llvm-branch-commits
mailing list