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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp index b9b2841..bf6d694 100644 --- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -195,8 +195,8 @@ public: void getAnalysisUsage(AnalysisUsage &AU) const override { AU.setPreservesCFG(); AU.addUsedIfAvailable<AAResultsWrapperPass>(); - AU.addUsedIfAvailable<LiveVariables>(); - AU.addPreserved<LiveVariables>(); + AU.addUsedIfAvailable<LiveVariablesWrapperPass>(); + AU.addPreserved<LiveVariablesWrapperPass>(); AU.addPreserved<SlotIndexes>(); AU.addPreserved<LiveIntervals>(); AU.addPreservedID(MachineLoopInfoID); @@ -1762,7 +1762,8 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &Func) { TII = MF->getSubtarget().getInstrInfo(); TRI = MF->getSubtarget().getRegisterInfo(); InstrItins = MF->getSubtarget().getInstrItineraryData(); - LV = getAnalysisIfAvailable<LiveVariables>(); + auto *LVWrapper = getAnalysisIfAvailable<LiveVariablesWrapperPass>(); + LV = LVWrapper ? &LVWrapper->getLV() : nullptr; LIS = getAnalysisIfAvailable<LiveIntervals>(); if (auto *AAPass = getAnalysisIfAvailable<AAResultsWrapperPass>()) AA = &AAPass->getAAResults(); |