Skip to content

Commit 9550da6

Browse files
committed
NFC: Move RegAlloc headers to include dir
1 parent d13349b commit 9550da6

13 files changed

+32
-42
lines changed

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

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class LLVM_LIBRARY_VISIBILITY InterferenceCache {
142142

143143
// Point to an entry for each physreg. The entry pointed to may not be up to
144144
// date, and it may have been reused for a different physreg.
145-
unsigned char* PhysRegEntries = nullptr;
145+
unsigned char *PhysRegEntries = nullptr;
146146
size_t PhysRegEntriesCount = 0;
147147

148148
// Next round-robin entry to be picked.
@@ -158,9 +158,7 @@ class LLVM_LIBRARY_VISIBILITY InterferenceCache {
158158
InterferenceCache() = default;
159159
InterferenceCache &operator=(const InterferenceCache &other) = delete;
160160
InterferenceCache(const InterferenceCache &other) = delete;
161-
~InterferenceCache() {
162-
free(PhysRegEntries);
163-
}
161+
~InterferenceCache() { free(PhysRegEntries); }
164162

165163
void reinitPhysRegEntries();
166164

@@ -194,9 +192,7 @@ class LLVM_LIBRARY_VISIBILITY InterferenceCache {
194192
/// Cursor - Create a dangling cursor.
195193
Cursor() = default;
196194

197-
Cursor(const Cursor &O) {
198-
setEntry(O.CacheEntry);
199-
}
195+
Cursor(const Cursor &O) { setEntry(O.CacheEntry); }
200196

201197
Cursor &operator=(const Cursor &O) {
202198
setEntry(O.CacheEntry);
@@ -220,21 +216,15 @@ class LLVM_LIBRARY_VISIBILITY InterferenceCache {
220216
}
221217

222218
/// hasInterference - Return true if the current block has any interference.
223-
bool hasInterference() {
224-
return Current->First.isValid();
225-
}
219+
bool hasInterference() { return Current->First.isValid(); }
226220

227221
/// first - Return the starting index of the first interfering range in the
228222
/// current block.
229-
SlotIndex first() {
230-
return Current->First;
231-
}
223+
SlotIndex first() { return Current->First; }
232224

233225
/// last - Return the ending index of the last interfering range in the
234226
/// current block.
235-
SlotIndex last() {
236-
return Current->Last;
237-
}
227+
SlotIndex last() { return Current->Last; }
238228
};
239229
};
240230

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class LiveIntervals;
4848
class LiveRegMatrix;
4949
class MachineInstr;
5050
class MachineRegisterInfo;
51-
template<typename T> class SmallVectorImpl;
51+
template <typename T> class SmallVectorImpl;
5252
class Spiller;
5353
class TargetRegisterInfo;
5454
class VirtRegMap;

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ class LLVM_LIBRARY_VISIBILITY InsertPointAnalysis {
8888
}
8989
return Res;
9090
}
91-
9291
};
9392

9493
/// SplitAnalysis - Analyze a LiveInterval, looking for live range splitting
@@ -387,7 +386,7 @@ class LLVM_LIBRARY_VISIBILITY SplitEditor {
387386

388387
/// removeBackCopies - Remove the copy instructions that defines the values
389388
/// in the vector in the complement interval.
390-
void removeBackCopies(SmallVectorImpl<VNInfo*> &Copies);
389+
void removeBackCopies(SmallVectorImpl<VNInfo *> &Copies);
391390

392391
/// getShallowDominator - Returns the least busy dominator of MBB that is
393392
/// also dominated by DefMBB. Busy is measured by loop depth.
@@ -430,8 +429,9 @@ class LLVM_LIBRARY_VISIBILITY SplitEditor {
430429
/// \p InsertBefore. This can be invoked with a \p LaneMask which may make it
431430
/// necessary to construct a sequence of copies to cover it exactly.
432431
SlotIndex buildCopy(Register FromReg, Register ToReg, LaneBitmask LaneMask,
433-
MachineBasicBlock &MBB, MachineBasicBlock::iterator InsertBefore,
434-
bool Late, unsigned RegIdx);
432+
MachineBasicBlock &MBB,
433+
MachineBasicBlock::iterator InsertBefore, bool Late,
434+
unsigned RegIdx);
435435

436436
SlotIndex buildSingleSubRegCopy(Register FromReg, Register ToReg,
437437
MachineBasicBlock &MB,
@@ -448,7 +448,7 @@ class LLVM_LIBRARY_VISIBILITY SplitEditor {
448448
VirtRegAuxInfo &VRAI);
449449

450450
/// reset - Prepare for a new split.
451-
void reset(LiveRangeEdit&, ComplementSpillMode = SM_Partition);
451+
void reset(LiveRangeEdit &, ComplementSpillMode = SM_Partition);
452452

453453
/// Create a new virtual register and live interval.
454454
/// Return the interval index, starting from 1. Interval index 0 is the
@@ -533,9 +533,9 @@ class LLVM_LIBRARY_VISIBILITY SplitEditor {
533533
/// @param LeaveBefore When set, leave IntvIn before this point.
534534
/// @param IntvOut Interval index leaving the block.
535535
/// @param EnterAfter When set, enter IntvOut after this point.
536-
void splitLiveThroughBlock(unsigned MBBNum,
537-
unsigned IntvIn, SlotIndex LeaveBefore,
538-
unsigned IntvOut, SlotIndex EnterAfter);
536+
void splitLiveThroughBlock(unsigned MBBNum, unsigned IntvIn,
537+
SlotIndex LeaveBefore, unsigned IntvOut,
538+
SlotIndex EnterAfter);
539539

540540
/// splitRegInBlock - Split CurLI in the given block such that it enters the
541541
/// block in IntvIn and leaves it on the stack (or not at all). Split points
@@ -545,8 +545,8 @@ class LLVM_LIBRARY_VISIBILITY SplitEditor {
545545
/// @param BI Block descriptor.
546546
/// @param IntvIn Interval index entering the block. Not 0.
547547
/// @param LeaveBefore When set, leave IntvIn before this point.
548-
void splitRegInBlock(const SplitAnalysis::BlockInfo &BI,
549-
unsigned IntvIn, SlotIndex LeaveBefore);
548+
void splitRegInBlock(const SplitAnalysis::BlockInfo &BI, unsigned IntvIn,
549+
SlotIndex LeaveBefore);
550550

551551
/// splitRegOutBlock - Split CurLI in the given block such that it enters the
552552
/// block on the stack (or isn't live-in at all) and leaves it in IntvOut.
@@ -557,8 +557,8 @@ class LLVM_LIBRARY_VISIBILITY SplitEditor {
557557
/// @param BI Block descriptor.
558558
/// @param IntvOut Interval index leaving the block.
559559
/// @param EnterAfter When set, enter IntvOut after this point.
560-
void splitRegOutBlock(const SplitAnalysis::BlockInfo &BI,
561-
unsigned IntvOut, SlotIndex EnterAfter);
560+
void splitRegOutBlock(const SplitAnalysis::BlockInfo &BI, unsigned IntvOut,
561+
SlotIndex EnterAfter);
562562
};
563563

564564
} // end namespace llvm

llvm/lib/CodeGen/InlineSpiller.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
#include "SplitKit.h"
1514
#include "llvm/ADT/ArrayRef.h"
1615
#include "llvm/ADT/DenseMap.h"
1716
#include "llvm/ADT/MapVector.h"
@@ -36,6 +35,7 @@
3635
#include "llvm/CodeGen/MachineRegisterInfo.h"
3736
#include "llvm/CodeGen/SlotIndexes.h"
3837
#include "llvm/CodeGen/Spiller.h"
38+
#include "llvm/CodeGen/SplitKit.h"
3939
#include "llvm/CodeGen/StackMaps.h"
4040
#include "llvm/CodeGen/TargetInstrInfo.h"
4141
#include "llvm/CodeGen/TargetOpcodes.h"

llvm/lib/CodeGen/InterferenceCache.cpp

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

13-
#include "InterferenceCache.h"
13+
#include "llvm/CodeGen/InterferenceCache.h"
1414
#include "llvm/ADT/ArrayRef.h"
1515
#include "llvm/CodeGen/LiveIntervals.h"
1616
#include "llvm/CodeGen/MachineBasicBlock.h"

llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#include "AllocationOrder.h"
14-
#include "RegAllocGreedy.h"
1514
#include "llvm/Analysis/InteractiveModelRunner.h"
1615
#include "llvm/Analysis/MLModelRunner.h"
1716
#include "llvm/Analysis/TensorSpec.h"
1817
#include "llvm/CodeGen/RegAllocEvictionAdvisor.h"
18+
#include "llvm/CodeGen/RegAllocGreedy.h"
1919
#if defined(LLVM_HAVE_TF_AOT_REGALLOCEVICTMODEL) || defined(LLVM_HAVE_TFLITE)
2020
#include "llvm/Analysis/ModelUnderTrainingRunner.h"
2121
#include "llvm/Analysis/NoInferenceModelRunner.h"

llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#include "AllocationOrder.h"
14-
#include "RegAllocGreedy.h"
1514
#include "llvm/Analysis/AliasAnalysis.h"
1615
#include "llvm/Analysis/InteractiveModelRunner.h"
1716
#include "llvm/Analysis/MLModelRunner.h"
@@ -24,6 +23,7 @@
2423
#include "llvm/CodeGen/MachineLoopInfo.h"
2524
#include "llvm/CodeGen/MachineRegisterInfo.h"
2625
#include "llvm/CodeGen/Passes.h"
26+
#include "llvm/CodeGen/RegAllocGreedy.h"
2727
#include "llvm/CodeGen/RegAllocPriorityAdvisor.h"
2828
#include "llvm/CodeGen/RegisterClassInfo.h"
2929
#include "llvm/CodeGen/SlotIndexes.h"

llvm/lib/CodeGen/RegAllocBase.cpp

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

14-
#include "RegAllocBase.h"
14+
#include "llvm/CodeGen/RegAllocBase.h"
1515
#include "llvm/ADT/SmallVector.h"
1616
#include "llvm/ADT/Statistic.h"
1717
#include "llvm/CodeGen/LiveInterval.h"

llvm/lib/CodeGen/RegAllocBasic.cpp

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

1414
#include "AllocationOrder.h"
15-
#include "RegAllocBase.h"
1615
#include "llvm/Analysis/AliasAnalysis.h"
1716
#include "llvm/Analysis/ProfileSummaryInfo.h"
1817
#include "llvm/CodeGen/CalcSpillWeights.h"
@@ -26,6 +25,7 @@
2625
#include "llvm/CodeGen/MachineFunctionPass.h"
2726
#include "llvm/CodeGen/MachineLoopInfo.h"
2827
#include "llvm/CodeGen/Passes.h"
28+
#include "llvm/CodeGen/RegAllocBase.h"
2929
#include "llvm/CodeGen/RegAllocRegistry.h"
3030
#include "llvm/CodeGen/Spiller.h"
3131
#include "llvm/CodeGen/TargetRegisterInfo.h"

llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
//===----------------------------------------------------------------------===//
1212
#include "llvm/CodeGen/RegAllocEvictionAdvisor.h"
1313
#include "AllocationOrder.h"
14-
#include "RegAllocGreedy.h"
1514
#include "llvm/CodeGen/LiveRegMatrix.h"
1615
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
1716
#include "llvm/CodeGen/MachineFunction.h"
1817
#include "llvm/CodeGen/MachineLoopInfo.h"
18+
#include "llvm/CodeGen/RegAllocGreedy.h"
1919
#include "llvm/CodeGen/RegAllocPriorityAdvisor.h"
2020
#include "llvm/CodeGen/RegisterClassInfo.h"
2121
#include "llvm/CodeGen/VirtRegMap.h"

llvm/lib/CodeGen/RegAllocGreedy.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
#include "RegAllocGreedy.h"
14+
#include "llvm/CodeGen/RegAllocGreedy.h"
1515
#include "AllocationOrder.h"
16-
#include "InterferenceCache.h"
17-
#include "RegAllocBase.h"
18-
#include "SplitKit.h"
1916
#include "llvm/ADT/ArrayRef.h"
2017
#include "llvm/ADT/BitVector.h"
2118
#include "llvm/ADT/IndexedMap.h"
@@ -26,6 +23,7 @@
2623
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
2724
#include "llvm/CodeGen/CalcSpillWeights.h"
2825
#include "llvm/CodeGen/EdgeBundles.h"
26+
#include "llvm/CodeGen/InterferenceCache.h"
2927
#include "llvm/CodeGen/LiveDebugVariables.h"
3028
#include "llvm/CodeGen/LiveInterval.h"
3129
#include "llvm/CodeGen/LiveIntervalUnion.h"
@@ -44,13 +42,15 @@
4442
#include "llvm/CodeGen/MachineOperand.h"
4543
#include "llvm/CodeGen/MachineOptimizationRemarkEmitter.h"
4644
#include "llvm/CodeGen/MachineRegisterInfo.h"
45+
#include "llvm/CodeGen/RegAllocBase.h"
4746
#include "llvm/CodeGen/RegAllocEvictionAdvisor.h"
4847
#include "llvm/CodeGen/RegAllocPriorityAdvisor.h"
4948
#include "llvm/CodeGen/RegAllocRegistry.h"
5049
#include "llvm/CodeGen/RegisterClassInfo.h"
5150
#include "llvm/CodeGen/SlotIndexes.h"
5251
#include "llvm/CodeGen/SpillPlacement.h"
5352
#include "llvm/CodeGen/Spiller.h"
53+
#include "llvm/CodeGen/SplitKit.h"
5454
#include "llvm/CodeGen/TargetInstrInfo.h"
5555
#include "llvm/CodeGen/TargetRegisterInfo.h"
5656
#include "llvm/CodeGen/TargetSubtargetInfo.h"

llvm/lib/CodeGen/RegAllocPriorityAdvisor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#include "llvm/CodeGen/RegAllocPriorityAdvisor.h"
14-
#include "RegAllocGreedy.h"
1514
#include "llvm/CodeGen/MachineFunction.h"
15+
#include "llvm/CodeGen/RegAllocGreedy.h"
1616
#include "llvm/CodeGen/VirtRegMap.h"
1717
#include "llvm/IR/Module.h"
1818
#include "llvm/InitializePasses.h"

llvm/lib/CodeGen/SplitKit.cpp

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

14-
#include "SplitKit.h"
14+
#include "llvm/CodeGen/SplitKit.h"
1515
#include "llvm/ADT/STLExtras.h"
1616
#include "llvm/ADT/Statistic.h"
1717
#include "llvm/CodeGen/LiveRangeEdit.h"

0 commit comments

Comments
 (0)