Skip to content

Commit 8d7ab0b

Browse files
committed
[CodeGen] Preserved additional analyses in StackSlotColoring pass.
The pass pipeline of some architecture splits register allocation phase based on different register classes. As some analyses need to be computed at the beginning of the register allocation and kept alive till all values are assigned to some physical registers. This poses challenge with objective of introducing StackSlotColoring after partial virtual registers are assigned to physical registers, in order to optimize stack slots usage.As this pass doesn't preserve few analysis yet to be needed by the register allocation of the remaining virtual registers, necessiating them to be kept preserved.
1 parent 92533bf commit 8d7ab0b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/CodeGen/StackSlotColoring.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "llvm/ADT/BitVector.h"
1414
#include "llvm/ADT/SmallVector.h"
1515
#include "llvm/ADT/Statistic.h"
16+
#include "llvm/CodeGen/LiveDebugVariables.h"
1617
#include "llvm/CodeGen/LiveInterval.h"
1718
#include "llvm/CodeGen/LiveIntervalUnion.h"
1819
#include "llvm/CodeGen/LiveIntervals.h"
@@ -64,6 +65,7 @@ namespace {
6465
MachineFrameInfo *MFI = nullptr;
6566
const TargetInstrInfo *TII = nullptr;
6667
const MachineBlockFrequencyInfo *MBFI = nullptr;
68+
SlotIndexes *Indexes = nullptr;
6769

6870
// SSIntervals - Spill slot intervals.
6971
std::vector<LiveInterval*> SSIntervals;
@@ -526,6 +528,7 @@ bool StackSlotColoring::runOnMachineFunction(MachineFunction &MF) {
526528
TII = MF.getSubtarget().getInstrInfo();
527529
LS = &getAnalysis<LiveStacks>();
528530
MBFI = &getAnalysis<MachineBlockFrequencyInfo>();
531+
Indexes = &getAnalysis<SlotIndexes>();
529532

530533
bool Changed = false;
531534

0 commit comments

Comments
 (0)