[llvm-branch-commits] [llvm] [NewPM][CodeGen] Port LiveRegMatrix to NPM (PR #109938)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Sep 25 04:48:21 PDT 2024


================
@@ -57,15 +59,21 @@ class LiveRegMatrix : public MachineFunctionPass {
   unsigned RegMaskVirtReg = 0;
   BitVector RegMaskUsable;
 
-  // MachineFunctionPass boilerplate.
-  void getAnalysisUsage(AnalysisUsage &) const override;
-  bool runOnMachineFunction(MachineFunction &) override;
-  void releaseMemory() override;
+  LiveRegMatrix() = default;
+  void releaseMemory();
 
 public:
-  static char ID;
-
-  LiveRegMatrix();
+  LiveRegMatrix(LiveRegMatrix &&Other)
+      : TRI(Other.TRI), LIS(Other.LIS), VRM(Other.VRM), UserTag(Other.UserTag),
+        Matrix(std::move(Other.Matrix)), Queries(std::move(Other.Queries)),
+        RegMaskTag(Other.RegMaskTag), RegMaskVirtReg(Other.RegMaskVirtReg),
+        RegMaskUsable(std::move(Other.RegMaskUsable)) {
+    Other.TRI = nullptr;
+    Other.LIS = nullptr;
+    Other.VRM = nullptr;
----------------
arsenm wrote:

Shouldn't need to clear these from Other 

https://github.com/llvm/llvm-project/pull/109938


More information about the llvm-branch-commits mailing list