[llvm] [CFIInstrInserter][NFC] Move `class CSRSavedLocation` definition. (PR #176053)
Mikhail Gudim via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 14 14:44:18 PST 2026
https://github.com/mgudim created https://github.com/llvm/llvm-project/pull/176053
This is needed to minimize diff for the future commit where we plan to use `CSRSavedLocation` in `stuct MBBCFAInfo`.
>From 4bb9604516d18a8bbf84969a52e5a429fa87c906 Mon Sep 17 00:00:00 2001
From: Mikhail Gudim <mgudim at qti.qualcomm.com>
Date: Wed, 14 Jan 2026 14:40:16 -0800
Subject: [PATCH] [CFIInstrInserter][NFC] Move `class CSRSavedLocation`
definition.
This is needed to minimize diff for the future commit where we plan to
use `CSRSavedLocation` in `stuct MBBCFAInfo`.
---
llvm/lib/CodeGen/CFIInstrInserter.cpp | 42 +++++++++++++--------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/llvm/lib/CodeGen/CFIInstrInserter.cpp b/llvm/lib/CodeGen/CFIInstrInserter.cpp
index 0fd082129e3a2..eac6eb62d2ce1 100644
--- a/llvm/lib/CodeGen/CFIInstrInserter.cpp
+++ b/llvm/lib/CodeGen/CFIInstrInserter.cpp
@@ -66,27 +66,6 @@ class CFIInstrInserter : public MachineFunctionPass {
}
private:
- struct MBBCFAInfo {
- MachineBasicBlock *MBB;
- /// Value of cfa offset valid at basic block entry.
- int64_t IncomingCFAOffset = -1;
- /// Value of cfa offset valid at basic block exit.
- int64_t OutgoingCFAOffset = -1;
- /// Value of cfa register valid at basic block entry.
- unsigned IncomingCFARegister = 0;
- /// Value of cfa register valid at basic block exit.
- unsigned OutgoingCFARegister = 0;
- /// Set of callee saved registers saved at basic block entry.
- BitVector IncomingCSRSaved;
- /// Set of callee saved registers saved at basic block exit.
- BitVector OutgoingCSRSaved;
- /// If in/out cfa offset and register values for this block have already
- /// been set or not.
- bool Processed = false;
- };
-
-#define INVALID_REG UINT_MAX
-#define INVALID_OFFSET INT_MAX
/// contains the location where CSR register is saved.
class CSRSavedLocation {
public:
@@ -148,6 +127,27 @@ class CFIInstrInserter : public MachineFunctionPass {
}
};
+ struct MBBCFAInfo {
+ MachineBasicBlock *MBB;
+ /// Value of cfa offset valid at basic block entry.
+ int64_t IncomingCFAOffset = -1;
+ /// Value of cfa offset valid at basic block exit.
+ int64_t OutgoingCFAOffset = -1;
+ /// Value of cfa register valid at basic block entry.
+ unsigned IncomingCFARegister = 0;
+ /// Value of cfa register valid at basic block exit.
+ unsigned OutgoingCFARegister = 0;
+ /// Set of callee saved registers saved at basic block entry.
+ BitVector IncomingCSRSaved;
+ /// Set of callee saved registers saved at basic block exit.
+ BitVector OutgoingCSRSaved;
+ /// If in/out cfa offset and register values for this block have already
+ /// been set or not.
+ bool Processed = false;
+ };
+
+#define INVALID_REG UINT_MAX
+#define INVALID_OFFSET INT_MAX
/// Contains cfa offset and register values valid at entry and exit of basic
/// blocks.
std::vector<MBBCFAInfo> MBBVector;
More information about the llvm-commits
mailing list