diff options
author | paperchalice <liujunchang97@outlook.com> | 2024-07-09 10:50:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-09 10:50:43 +0800 |
commit | ac0b2814c34959ebaa8f054db019bd287fdff54d (patch) | |
tree | 9e1b742258464c471c2b869c7ab694ba280e6db1 /llvm/lib/CodeGen/MachineVerifier.cpp | |
parent | 366eb8f025f03f00ed1188dccfd3d527b8c82892 (diff) | |
download | llvm-ac0b2814c34959ebaa8f054db019bd287fdff54d.zip llvm-ac0b2814c34959ebaa8f054db019bd287fdff54d.tar.gz llvm-ac0b2814c34959ebaa8f054db019bd287fdff54d.tar.bz2 |
[CodeGen][NewPM] Port `LiveVariables` to new pass manager (#97880)
- Port `LiveVariables` to new pass manager.
- Convert to `LiveVariablesWrapperPass` in legacy pass manager.
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index 0c8a0f2..612631ac 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -314,7 +314,7 @@ namespace { void getAnalysisUsage(AnalysisUsage &AU) const override { AU.addUsedIfAvailable<LiveStacks>(); - AU.addUsedIfAvailable<LiveVariables>(); + AU.addUsedIfAvailable<LiveVariablesWrapperPass>(); AU.addUsedIfAvailable<SlotIndexes>(); AU.addUsedIfAvailable<LiveIntervals>(); AU.setPreservesAll(); @@ -430,8 +430,9 @@ unsigned MachineVerifier::verify(const MachineFunction &MF) { if (PASS) { LiveInts = PASS->getAnalysisIfAvailable<LiveIntervals>(); // We don't want to verify LiveVariables if LiveIntervals is available. + auto *LVWrapper = PASS->getAnalysisIfAvailable<LiveVariablesWrapperPass>(); if (!LiveInts) - LiveVars = PASS->getAnalysisIfAvailable<LiveVariables>(); + LiveVars = LVWrapper ? &LVWrapper->getLV() : nullptr; LiveStks = PASS->getAnalysisIfAvailable<LiveStacks>(); Indexes = PASS->getAnalysisIfAvailable<SlotIndexes>(); } |