Skip to content

[CodeGen][NewPM] Port LiveStacks analysis to NPM #118778

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 39 additions & 7 deletions llvm/include/llvm/CodeGen/LiveStacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/IR/PassManager.h"
#include "llvm/InitializePasses.h"
#include "llvm/PassRegistry.h"
#include <cassert>
Expand All @@ -32,7 +33,7 @@ class raw_ostream;
class TargetRegisterClass;
class TargetRegisterInfo;

class LiveStacks : public MachineFunctionPass {
class LiveStacks {
const TargetRegisterInfo *TRI = nullptr;

/// Special pool allocator for VNInfo's (LiveInterval val#).
Expand All @@ -47,12 +48,6 @@ class LiveStacks : public MachineFunctionPass {
std::map<int, const TargetRegisterClass *> S2RCMap;

public:
static char ID; // Pass identification, replacement for typeid

LiveStacks() : MachineFunctionPass(ID) {
initializeLiveStacksPass(*PassRegistry::getPassRegistry());
}

using iterator = SS2IntervalMap::iterator;
using const_iterator = SS2IntervalMap::const_iterator;

Expand Down Expand Up @@ -92,6 +87,25 @@ class LiveStacks : public MachineFunctionPass {

VNInfo::Allocator &getVNInfoAllocator() { return VNInfoAllocator; }

void releaseMemory();
/// init - analysis entry point
void init(MachineFunction &MF);
void print(raw_ostream &O, const Module *M = nullptr) const;
};

class LiveStacksWrapperLegacy : public MachineFunctionPass {
LiveStacks Impl;

public:
static char ID; // Pass identification, replacement for typeid

LiveStacksWrapperLegacy() : MachineFunctionPass(ID) {
initializeLiveStacksWrapperLegacyPass(*PassRegistry::getPassRegistry());
}

LiveStacks &getLS() { return Impl; }
const LiveStacks &getLS() const { return Impl; }

void getAnalysisUsage(AnalysisUsage &AU) const override;
void releaseMemory() override;

Expand All @@ -102,6 +116,24 @@ class LiveStacks : public MachineFunctionPass {
void print(raw_ostream &O, const Module * = nullptr) const override;
};

class LiveStacksAnalysis : public AnalysisInfoMixin<LiveStacksAnalysis> {
static AnalysisKey Key;
friend AnalysisInfoMixin<LiveStacksAnalysis>;

public:
using Result = LiveStacks;

LiveStacks run(MachineFunction &MF, MachineFunctionAnalysisManager &);
};

class LiveStacksPrinterPass : public PassInfoMixin<LiveStacksPrinterPass> {
raw_ostream &OS;

public:
LiveStacksPrinterPass(raw_ostream &OS) : OS(OS) {}
PreservedAnalyses run(MachineFunction &MF,
MachineFunctionAnalysisManager &AM);
};
} // end namespace llvm

#endif
2 changes: 1 addition & 1 deletion llvm/include/llvm/InitializePasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void initializeLiveDebugVariablesWrapperLegacyPass(PassRegistry &);
void initializeLiveIntervalsWrapperPassPass(PassRegistry &);
void initializeLiveRangeShrinkPass(PassRegistry &);
void initializeLiveRegMatrixWrapperLegacyPass(PassRegistry &);
void initializeLiveStacksPass(PassRegistry &);
void initializeLiveStacksWrapperLegacyPass(PassRegistry &);
void initializeLiveVariablesWrapperPassPass(PassRegistry &);
void initializeLoadStoreOptPass(PassRegistry &);
void initializeLoadStoreVectorizerLegacyPassPass(PassRegistry &);
Expand Down
3 changes: 2 additions & 1 deletion llvm/include/llvm/Passes/MachinePassRegistry.def
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ MACHINE_FUNCTION_ANALYSIS("edge-bundles", EdgeBundlesAnalysis())
MACHINE_FUNCTION_ANALYSIS("livedebugvars", LiveDebugVariablesAnalysis())
MACHINE_FUNCTION_ANALYSIS("live-intervals", LiveIntervalsAnalysis())
MACHINE_FUNCTION_ANALYSIS("live-reg-matrix", LiveRegMatrixAnalysis())
MACHINE_FUNCTION_ANALYSIS("live-stacks", LiveStacksAnalysis())
MACHINE_FUNCTION_ANALYSIS("live-vars", LiveVariablesAnalysis())
MACHINE_FUNCTION_ANALYSIS("machine-block-freq", MachineBlockFrequencyAnalysis())
MACHINE_FUNCTION_ANALYSIS("machine-branch-prob",
Expand All @@ -116,7 +117,6 @@ MACHINE_FUNCTION_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PI
MACHINE_FUNCTION_ANALYSIS("slot-indexes", SlotIndexesAnalysis())
MACHINE_FUNCTION_ANALYSIS("spill-code-placement", SpillPlacementAnalysis())
MACHINE_FUNCTION_ANALYSIS("virtregmap", VirtRegMapAnalysis())
// MACHINE_FUNCTION_ANALYSIS("live-stacks", LiveStacksPass())
// MACHINE_FUNCTION_ANALYSIS("lazy-machine-bfi",
// LazyMachineBlockFrequencyInfoAnalysis())
// MACHINE_FUNCTION_ANALYSIS("machine-loops", MachineLoopInfoAnalysis())
Expand Down Expand Up @@ -149,6 +149,7 @@ MACHINE_FUNCTION_PASS("phi-node-elimination", PHIEliminationPass())
MACHINE_FUNCTION_PASS("print", PrintMIRPass())
MACHINE_FUNCTION_PASS("print<livedebugvars>", LiveDebugVariablesPrinterPass(errs()))
MACHINE_FUNCTION_PASS("print<live-intervals>", LiveIntervalsPrinterPass(errs()))
MACHINE_FUNCTION_PASS("print<live-stacks>", LiveStacksPrinterPass(errs()))
MACHINE_FUNCTION_PASS("print<live-vars>", LiveVariablesPrinterPass(errs()))
MACHINE_FUNCTION_PASS("print<machine-block-freq>",
MachineBlockFrequencyPrinterPass(errs()))
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/CodeGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void llvm::initializeCodeGen(PassRegistry &Registry) {
initializeLiveDebugVariablesWrapperLegacyPass(Registry);
initializeLiveIntervalsWrapperPassPass(Registry);
initializeLiveRangeShrinkPass(Registry);
initializeLiveStacksPass(Registry);
initializeLiveStacksWrapperLegacyPass(Registry);
initializeLiveVariablesWrapperPassPass(Registry);
initializeLocalStackSlotPassPass(Registry);
initializeLowerGlobalDtorsLegacyPassPass(Registry);
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/InlineSpiller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class HoistSpillHelper : private LiveRangeEdit::Delegate {
HoistSpillHelper(MachineFunctionPass &pass, MachineFunction &mf,
VirtRegMap &vrm)
: MF(mf), LIS(pass.getAnalysis<LiveIntervalsWrapperPass>().getLIS()),
LSS(pass.getAnalysis<LiveStacks>()),
LSS(pass.getAnalysis<LiveStacksWrapperLegacy>().getLS()),
MDT(pass.getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree()),
VRM(vrm), MRI(mf.getRegInfo()), TII(*mf.getSubtarget().getInstrInfo()),
TRI(*mf.getSubtarget().getRegisterInfo()),
Expand Down Expand Up @@ -193,7 +193,7 @@ class InlineSpiller : public Spiller {
InlineSpiller(MachineFunctionPass &Pass, MachineFunction &MF, VirtRegMap &VRM,
VirtRegAuxInfo &VRAI)
: MF(MF), LIS(Pass.getAnalysis<LiveIntervalsWrapperPass>().getLIS()),
LSS(Pass.getAnalysis<LiveStacks>()),
LSS(Pass.getAnalysis<LiveStacksWrapperLegacy>().getLS()),
MDT(Pass.getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree()),
VRM(VRM), MRI(MF.getRegInfo()), TII(*MF.getSubtarget().getInstrInfo()),
TRI(*MF.getSubtarget().getRegisterInfo()),
Expand Down
45 changes: 36 additions & 9 deletions llvm/lib/CodeGen/LiveStacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,21 @@
#include "llvm/CodeGen/LiveStacks.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/IR/Function.h"
using namespace llvm;

#define DEBUG_TYPE "livestacks"

char LiveStacks::ID = 0;
INITIALIZE_PASS_BEGIN(LiveStacks, DEBUG_TYPE,
"Live Stack Slot Analysis", false, false)
char LiveStacksWrapperLegacy::ID = 0;
INITIALIZE_PASS_BEGIN(LiveStacksWrapperLegacy, DEBUG_TYPE,
"Live Stack Slot Analysis", false, false)
INITIALIZE_PASS_DEPENDENCY(SlotIndexesWrapperPass)
INITIALIZE_PASS_END(LiveStacks, DEBUG_TYPE,
"Live Stack Slot Analysis", false, false)
INITIALIZE_PASS_END(LiveStacksWrapperLegacy, DEBUG_TYPE,
"Live Stack Slot Analysis", false, false)

char &llvm::LiveStacksID = LiveStacks::ID;
char &llvm::LiveStacksID = LiveStacksWrapperLegacy::ID;

void LiveStacks::getAnalysisUsage(AnalysisUsage &AU) const {
void LiveStacksWrapperLegacy::getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
AU.addPreserved<SlotIndexesWrapperPass>();
AU.addRequiredTransitive<SlotIndexesWrapperPass>();
Expand All @@ -42,11 +43,10 @@ void LiveStacks::releaseMemory() {
S2RCMap.clear();
}

bool LiveStacks::runOnMachineFunction(MachineFunction &MF) {
void LiveStacks::init(MachineFunction &MF) {
TRI = MF.getSubtarget().getRegisterInfo();
// FIXME: No analysis is being done right now. We are relying on the
// register allocators to provide the information.
return false;
}

LiveInterval &
Expand All @@ -68,6 +68,33 @@ LiveStacks::getOrCreateInterval(int Slot, const TargetRegisterClass *RC) {
return I->second;
}

AnalysisKey LiveStacksAnalysis::Key;

LiveStacks LiveStacksAnalysis::run(MachineFunction &MF,
MachineFunctionAnalysisManager &) {
LiveStacks Impl;
Impl.init(MF);
return Impl;
}
PreservedAnalyses
LiveStacksPrinterPass::run(MachineFunction &MF,
MachineFunctionAnalysisManager &AM) {
AM.getResult<LiveStacksAnalysis>(MF).print(OS, MF.getFunction().getParent());
return PreservedAnalyses::all();
}

bool LiveStacksWrapperLegacy::runOnMachineFunction(MachineFunction &MF) {
Impl = LiveStacks();
Impl.init(MF);
return false;
}

void LiveStacksWrapperLegacy::releaseMemory() { Impl = LiveStacks(); }

void LiveStacksWrapperLegacy::print(raw_ostream &OS, const Module *) const {
Impl.print(OS);
}

/// print - Implement the dump method.
void LiveStacks::print(raw_ostream &OS, const Module*) const {

Expand Down
5 changes: 3 additions & 2 deletions llvm/lib/CodeGen/MachineVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ struct MachineVerifierLegacyPass : public MachineFunctionPass {
}

void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addUsedIfAvailable<LiveStacks>();
AU.addUsedIfAvailable<LiveStacksWrapperLegacy>();
AU.addUsedIfAvailable<LiveVariablesWrapperPass>();
AU.addUsedIfAvailable<SlotIndexesWrapperPass>();
AU.addUsedIfAvailable<LiveIntervalsWrapperPass>();
Expand Down Expand Up @@ -491,7 +491,8 @@ bool MachineVerifier::verify(const MachineFunction &MF) {
auto *LVWrapper = PASS->getAnalysisIfAvailable<LiveVariablesWrapperPass>();
if (!LiveInts)
LiveVars = LVWrapper ? &LVWrapper->getLV() : nullptr;
LiveStks = PASS->getAnalysisIfAvailable<LiveStacks>();
auto *LSWrapper = PASS->getAnalysisIfAvailable<LiveStacksWrapperLegacy>();
LiveStks = LSWrapper ? &LSWrapper->getLS() : nullptr;
auto *SIWrapper = PASS->getAnalysisIfAvailable<SlotIndexesWrapperPass>();
Indexes = SIWrapper ? &SIWrapper->getSI() : nullptr;
}
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/CodeGen/RegAllocBasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ INITIALIZE_PASS_DEPENDENCY(SlotIndexesWrapperPass)
INITIALIZE_PASS_DEPENDENCY(LiveIntervalsWrapperPass)
INITIALIZE_PASS_DEPENDENCY(RegisterCoalescer)
INITIALIZE_PASS_DEPENDENCY(MachineScheduler)
INITIALIZE_PASS_DEPENDENCY(LiveStacks)
INITIALIZE_PASS_DEPENDENCY(LiveStacksWrapperLegacy)
INITIALIZE_PASS_DEPENDENCY(AAResultsWrapperPass)
INITIALIZE_PASS_DEPENDENCY(MachineDominatorTreeWrapperPass)
INITIALIZE_PASS_DEPENDENCY(MachineLoopInfoWrapperPass)
Expand Down Expand Up @@ -182,8 +182,8 @@ void RABasic::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addPreserved<SlotIndexesWrapperPass>();
AU.addRequired<LiveDebugVariablesWrapperLegacy>();
AU.addPreserved<LiveDebugVariablesWrapperLegacy>();
AU.addRequired<LiveStacks>();
AU.addPreserved<LiveStacks>();
AU.addRequired<LiveStacksWrapperLegacy>();
AU.addPreserved<LiveStacksWrapperLegacy>();
AU.addRequired<ProfileSummaryInfoWrapperPass>();
AU.addRequired<MachineBlockFrequencyInfoWrapperPass>();
AU.addPreserved<MachineBlockFrequencyInfoWrapperPass>();
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/CodeGen/RegAllocGreedy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ INITIALIZE_PASS_DEPENDENCY(SlotIndexesWrapperPass)
INITIALIZE_PASS_DEPENDENCY(LiveIntervalsWrapperPass)
INITIALIZE_PASS_DEPENDENCY(RegisterCoalescer)
INITIALIZE_PASS_DEPENDENCY(MachineScheduler)
INITIALIZE_PASS_DEPENDENCY(LiveStacks)
INITIALIZE_PASS_DEPENDENCY(LiveStacksWrapperLegacy)
INITIALIZE_PASS_DEPENDENCY(MachineDominatorTreeWrapperPass)
INITIALIZE_PASS_DEPENDENCY(MachineLoopInfoWrapperPass)
INITIALIZE_PASS_DEPENDENCY(VirtRegMapWrapperLegacy)
Expand Down Expand Up @@ -206,8 +206,8 @@ void RAGreedy::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addPreserved<SlotIndexesWrapperPass>();
AU.addRequired<LiveDebugVariablesWrapperLegacy>();
AU.addPreserved<LiveDebugVariablesWrapperLegacy>();
AU.addRequired<LiveStacks>();
AU.addPreserved<LiveStacks>();
AU.addRequired<LiveStacksWrapperLegacy>();
AU.addPreserved<LiveStacksWrapperLegacy>();
AU.addRequired<MachineDominatorTreeWrapperPass>();
AU.addPreserved<MachineDominatorTreeWrapperPass>();
AU.addRequired<MachineLoopInfoWrapperPass>();
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/CodeGen/RegAllocPBQP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class RegAllocPBQP : public MachineFunctionPass {
: MachineFunctionPass(ID), customPassID(cPassID) {
initializeSlotIndexesWrapperPassPass(*PassRegistry::getPassRegistry());
initializeLiveIntervalsWrapperPassPass(*PassRegistry::getPassRegistry());
initializeLiveStacksPass(*PassRegistry::getPassRegistry());
initializeLiveStacksWrapperLegacyPass(*PassRegistry::getPassRegistry());
initializeVirtRegMapWrapperLegacyPass(*PassRegistry::getPassRegistry());
}

Expand Down Expand Up @@ -550,8 +550,8 @@ void RegAllocPBQP::getAnalysisUsage(AnalysisUsage &au) const {
//au.addRequiredID(SplitCriticalEdgesID);
if (customPassID)
au.addRequiredID(*customPassID);
au.addRequired<LiveStacks>();
au.addPreserved<LiveStacks>();
au.addRequired<LiveStacksWrapperLegacy>();
au.addPreserved<LiveStacksWrapperLegacy>();
au.addRequired<MachineBlockFrequencyInfoWrapperPass>();
au.addPreserved<MachineBlockFrequencyInfoWrapperPass>();
au.addRequired<MachineLoopInfoWrapperPass>();
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/CodeGen/StackSlotColoring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ namespace {
AU.setPreservesCFG();
AU.addRequired<SlotIndexesWrapperPass>();
AU.addPreserved<SlotIndexesWrapperPass>();
AU.addRequired<LiveStacks>();
AU.addRequired<LiveStacksWrapperLegacy>();
AU.addRequired<MachineBlockFrequencyInfoWrapperPass>();
AU.addPreserved<MachineBlockFrequencyInfoWrapperPass>();
AU.addPreservedID(MachineDominatorsID);
Expand Down Expand Up @@ -185,7 +185,7 @@ char &llvm::StackSlotColoringID = StackSlotColoring::ID;
INITIALIZE_PASS_BEGIN(StackSlotColoring, DEBUG_TYPE,
"Stack Slot Coloring", false, false)
INITIALIZE_PASS_DEPENDENCY(SlotIndexesWrapperPass)
INITIALIZE_PASS_DEPENDENCY(LiveStacks)
INITIALIZE_PASS_DEPENDENCY(LiveStacksWrapperLegacy)
INITIALIZE_PASS_DEPENDENCY(MachineLoopInfoWrapperPass)
INITIALIZE_PASS_END(StackSlotColoring, DEBUG_TYPE,
"Stack Slot Coloring", false, false)
Expand Down Expand Up @@ -522,7 +522,7 @@ bool StackSlotColoring::runOnMachineFunction(MachineFunction &MF) {

MFI = &MF.getFrameInfo();
TII = MF.getSubtarget().getInstrInfo();
LS = &getAnalysis<LiveStacks>();
LS = &getAnalysis<LiveStacksWrapperLegacy>().getLS();
MBFI = &getAnalysis<MachineBlockFrequencyInfoWrapperPass>().getMBFI();
Indexes = &getAnalysis<SlotIndexesWrapperPass>().getSI();

Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/CodeGen/VirtRegMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ INITIALIZE_PASS_DEPENDENCY(SlotIndexesWrapperPass)
INITIALIZE_PASS_DEPENDENCY(LiveIntervalsWrapperPass)
INITIALIZE_PASS_DEPENDENCY(LiveDebugVariablesWrapperLegacy)
INITIALIZE_PASS_DEPENDENCY(LiveRegMatrixWrapperLegacy)
INITIALIZE_PASS_DEPENDENCY(LiveStacks)
INITIALIZE_PASS_DEPENDENCY(LiveStacksWrapperLegacy)
INITIALIZE_PASS_DEPENDENCY(VirtRegMapWrapperLegacy)
INITIALIZE_PASS_END(VirtRegRewriter, "virtregrewriter",
"Virtual Register Rewriter", false, false)
Expand All @@ -265,8 +265,8 @@ void VirtRegRewriter::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<SlotIndexesWrapperPass>();
AU.addPreserved<SlotIndexesWrapperPass>();
AU.addRequired<LiveDebugVariablesWrapperLegacy>();
AU.addRequired<LiveStacks>();
AU.addPreserved<LiveStacks>();
AU.addRequired<LiveStacksWrapperLegacy>();
AU.addPreserved<LiveStacksWrapperLegacy>();
AU.addRequired<VirtRegMapWrapperLegacy>();
AU.addRequired<LiveRegMatrixWrapperLegacy>();

Expand Down
1 change: 1 addition & 0 deletions llvm/lib/Passes/PassBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
#include "llvm/CodeGen/LiveDebugVariables.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/LiveRegMatrix.h"
#include "llvm/CodeGen/LiveStacks.h"
#include "llvm/CodeGen/LiveVariables.h"
#include "llvm/CodeGen/LocalStackSlotAllocation.h"
#include "llvm/CodeGen/LowerEmuTLS.h"
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Target/AMDGPU/AMDGPUMarkLastScratchLoad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class AMDGPUMarkLastScratchLoad : public MachineFunctionPass {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequired<SlotIndexesWrapperPass>();
AU.addRequired<LiveIntervalsWrapperPass>();
AU.addRequired<LiveStacks>();
AU.addRequired<LiveStacksWrapperLegacy>();
AU.setPreservesAll();
MachineFunctionPass::getAnalysisUsage(AU);
}
Expand All @@ -64,7 +64,7 @@ bool AMDGPUMarkLastScratchLoad::runOnMachineFunction(MachineFunction &MF) {
if (ST.getGeneration() < AMDGPUSubtarget::GFX12)
return false;

LS = &getAnalysis<LiveStacks>();
LS = &getAnalysis<LiveStacksWrapperLegacy>().getLS();
LIS = &getAnalysis<LiveIntervalsWrapperPass>().getLIS();
SI = &getAnalysis<SlotIndexesWrapperPass>().getSI();
SII = ST.getInstrInfo();
Expand Down Expand Up @@ -137,6 +137,6 @@ char &llvm::AMDGPUMarkLastScratchLoadID = AMDGPUMarkLastScratchLoad::ID;
INITIALIZE_PASS_BEGIN(AMDGPUMarkLastScratchLoad, DEBUG_TYPE,
"AMDGPU Mark last scratch load", false, false)
INITIALIZE_PASS_DEPENDENCY(SlotIndexesWrapperPass)
INITIALIZE_PASS_DEPENDENCY(LiveStacks)
INITIALIZE_PASS_DEPENDENCY(LiveStacksWrapperLegacy)
INITIALIZE_PASS_END(AMDGPUMarkLastScratchLoad, DEBUG_TYPE,
"AMDGPU Mark last scratch load", false, false)
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class LoongArchDeadRegisterDefinitions : public MachineFunctionPass {
AU.addRequired<LiveIntervalsWrapperPass>();
AU.addPreserved<SlotIndexesWrapperPass>();
AU.addPreserved<LiveDebugVariablesWrapperLegacy>();
AU.addPreserved<LiveStacks>();
AU.addPreserved<LiveStacksWrapperLegacy>();
MachineFunctionPass::getAnalysisUsage(AU);
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/RISCV/RISCVDeadRegisterDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class RISCVDeadRegisterDefinitions : public MachineFunctionPass {
AU.addRequired<LiveIntervalsWrapperPass>();
AU.addPreserved<SlotIndexesWrapperPass>();
AU.addPreserved<LiveDebugVariablesWrapperLegacy>();
AU.addPreserved<LiveStacks>();
AU.addPreserved<LiveStacksWrapperLegacy>();
MachineFunctionPass::getAnalysisUsage(AU);
}

Expand Down
Loading
Loading