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/MachineBasicBlock.cpp | |
| parent | 366eb8f025f03f00ed1188dccfd3d527b8c82892 (diff) | |
[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/MachineBasicBlock.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index b5c3e1625f1a..82c833ed97f5 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -1171,7 +1171,8 @@ MachineBasicBlock *MachineBasicBlock::SplitCriticalEdge( // On some targets like Mips, branches may kill virtual registers. Make sure // that LiveVariables is properly updated after updateTerminator replaces the // terminators. - LiveVariables *LV = P.getAnalysisIfAvailable<LiveVariables>(); + auto *LVWrapper = P.getAnalysisIfAvailable<LiveVariablesWrapperPass>(); + LiveVariables *LV = LVWrapper ? &LVWrapper->getLV() : nullptr; // Collect a list of virtual registers killed by the terminators. SmallVector<Register, 4> KilledRegs; |
