Skip to content

Commit 953127d

Browse files
committed
Update tests and invalidate method
1 parent 527a3c7 commit 953127d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

llvm/include/llvm/CodeGen/RegisterUsageInfo.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ class PhysicalRegisterUsageInfo {
5151

5252
void print(raw_ostream &OS, const Module *M = nullptr) const;
5353

54+
bool invalidate(Module &M, const PreservedAnalyses &PA,
55+
ModuleAnalysisManager::Invalidator &Inv);
56+
5457
private:
5558
/// A Dense map from Function * to RegMask.
5659
/// In RegMask 0 means register used (clobbered) by function.

llvm/lib/CodeGen/RegisterUsageInfo.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ void PhysicalRegisterUsageInfo::print(raw_ostream &OS, const Module *M) const {
100100
}
101101
}
102102

103+
bool PhysicalRegisterUsageInfo::invalidate(
104+
Module &M, const PreservedAnalyses &PA,
105+
ModuleAnalysisManager::Invalidator &) {
106+
auto PAC = PA.getChecker<PhysicalRegisterUsageInfoAnalysis>();
107+
return !PAC.preservedWhenStateless();
108+
}
109+
103110
AnalysisKey PhysicalRegisterUsageInfoAnalysis::Key;
104111
PhysicalRegisterUsageInfo
105112
PhysicalRegisterUsageInfoAnalysis::run(Module &M, ModuleAnalysisManager &) {
@@ -114,4 +121,4 @@ PhysicalRegisterUsageInfoPrinterPass::run(Module &M,
114121
auto *PRUI = &AM.getResult<PhysicalRegisterUsageInfoAnalysis>(M);
115122
PRUI->print(OS, &M);
116123
return PreservedAnalyses::all();
117-
}
124+
}

0 commit comments

Comments
 (0)