Skip to content

Commit ae4a249

Browse files
committed
Simplify invalidate as the provider does not store analyses.
1 parent 4684323 commit ae4a249

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

llvm/include/llvm/CodeGen/RegAllocEvictionAdvisor.h

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -248,16 +248,9 @@ class RegAllocEvictionAdvisorAnalysis
248248

249249
bool invalidate(MachineFunction &MF, const PreservedAnalyses &PA,
250250
MachineFunctionAnalysisManager::Invalidator &Inv) {
251-
auto PAC = PA.getChecker<RegAllocEvictionAdvisorAnalysis>();
252-
// If we are in default mode, the provider is always valid.
253-
if (Provider->getAdvisorMode() ==
254-
RegAllocEvictionAdvisorProvider::AdvisorMode::Default)
255-
return !PAC.preservedWhenStateless();
256-
// MBFI and Loops are used in release and development modes, so check
257-
// those.
258-
return !PAC.preservedWhenStateless() ||
259-
Inv.invalidate<MachineBlockFrequencyAnalysis>(MF, PA) ||
260-
Inv.invalidate<MachineLoopAnalysis>(MF, PA);
251+
// Provider is stateless and constructed only once. Do not get
252+
// invalidated.
253+
return false;
261254
}
262255
};
263256

0 commit comments

Comments
 (0)