Skip to content

Commit 32cb3c5

Browse files
authored
[NFC][LLVM][CodeGen] Move LiveDebugVariables.h into llvm/include/llvm/CodeGen (#88374)
This patch make `LiveDebugVariables` can be used by passes outside of `lib/CodeGen`. If we run a pass that occurs between the split register allocation pass without preserving this pass, it will be freed and recomputed until it encounters the next pass that needs LiveDebugVariables. However, `LiveDebugVariables` will raise an assertion due to the pass being freed without emitting a debug value. This is reason we need `LiveDebugVariables` to be available for passes outside of lib/Codegen.
1 parent 105dcc8 commit 32cb3c5

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

llvm/lib/CodeGen/LiveDebugVariables.h renamed to llvm/include/llvm/CodeGen/LiveDebugVariables.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
//
1818
//===----------------------------------------------------------------------===//
1919

20-
#ifndef LLVM_LIB_CODEGEN_LIVEDEBUGVARIABLES_H
21-
#define LLVM_LIB_CODEGEN_LIVEDEBUGVARIABLES_H
20+
#ifndef LLVM_CODEGEN_LIVEDEBUGVARIABLES_H
21+
#define LLVM_CODEGEN_LIVEDEBUGVARIABLES_H
2222

2323
#include "llvm/CodeGen/MachineFunctionPass.h"
2424
#include "llvm/Support/Compiler.h"
@@ -29,7 +29,7 @@ template <typename T> class ArrayRef;
2929
class LiveIntervals;
3030
class VirtRegMap;
3131

32-
class LLVM_LIBRARY_VISIBILITY LiveDebugVariables : public MachineFunctionPass {
32+
class LiveDebugVariables : public MachineFunctionPass {
3333
void *pImpl = nullptr;
3434

3535
public:
@@ -65,4 +65,4 @@ class LLVM_LIBRARY_VISIBILITY LiveDebugVariables : public MachineFunctionPass {
6565

6666
} // end namespace llvm
6767

68-
#endif // LLVM_LIB_CODEGEN_LIVEDEBUGVARIABLES_H
68+
#endif // LLVM_CODEGEN_LIVEDEBUGVARIABLES_H

llvm/lib/CodeGen/LiveDebugVariables.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//
1919
//===----------------------------------------------------------------------===//
2020

21-
#include "LiveDebugVariables.h"
21+
#include "llvm/CodeGen/LiveDebugVariables.h"
2222
#include "llvm/ADT/ArrayRef.h"
2323
#include "llvm/ADT/DenseMap.h"
2424
#include "llvm/ADT/IntervalMap.h"

llvm/lib/CodeGen/RegAllocBasic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
//===----------------------------------------------------------------------===//
1313

1414
#include "AllocationOrder.h"
15-
#include "LiveDebugVariables.h"
1615
#include "RegAllocBase.h"
1716
#include "llvm/Analysis/AliasAnalysis.h"
1817
#include "llvm/CodeGen/CalcSpillWeights.h"
18+
#include "llvm/CodeGen/LiveDebugVariables.h"
1919
#include "llvm/CodeGen/LiveIntervals.h"
2020
#include "llvm/CodeGen/LiveRangeEdit.h"
2121
#include "llvm/CodeGen/LiveRegMatrix.h"

llvm/lib/CodeGen/RegAllocGreedy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "RegAllocGreedy.h"
1515
#include "AllocationOrder.h"
1616
#include "InterferenceCache.h"
17-
#include "LiveDebugVariables.h"
1817
#include "RegAllocBase.h"
1918
#include "RegAllocEvictionAdvisor.h"
2019
#include "RegAllocPriorityAdvisor.h"
@@ -31,6 +30,7 @@
3130
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
3231
#include "llvm/CodeGen/CalcSpillWeights.h"
3332
#include "llvm/CodeGen/EdgeBundles.h"
33+
#include "llvm/CodeGen/LiveDebugVariables.h"
3434
#include "llvm/CodeGen/LiveInterval.h"
3535
#include "llvm/CodeGen/LiveIntervalUnion.h"
3636
#include "llvm/CodeGen/LiveIntervals.h"

llvm/lib/CodeGen/VirtRegMap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
//===----------------------------------------------------------------------===//
1717

1818
#include "llvm/CodeGen/VirtRegMap.h"
19-
#include "LiveDebugVariables.h"
2019
#include "llvm/ADT/SmallVector.h"
2120
#include "llvm/ADT/Statistic.h"
21+
#include "llvm/CodeGen/LiveDebugVariables.h"
2222
#include "llvm/CodeGen/LiveInterval.h"
2323
#include "llvm/CodeGen/LiveIntervals.h"
2424
#include "llvm/CodeGen/LiveStacks.h"

0 commit comments

Comments
 (0)