From ac0b2814c34959ebaa8f054db019bd287fdff54d Mon Sep 17 00:00:00 2001 From: paperchalice Date: Tue, 9 Jul 2024 10:50:43 +0800 Subject: [CodeGen][NewPM] Port `LiveVariables` to new pass manager (#97880) - Port `LiveVariables` to new pass manager. - Convert to `LiveVariablesWrapperPass` in legacy pass manager. --- llvm/lib/CodeGen/MachineBasicBlock.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp') diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index b5c3e16..82c833e 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(); + auto *LVWrapper = P.getAnalysisIfAvailable(); + LiveVariables *LV = LVWrapper ? &LVWrapper->getLV() : nullptr; // Collect a list of virtual registers killed by the terminators. SmallVector KilledRegs; -- cgit v1.1