[llvm] [ARM] Add basic NPM support for LoadStoreOptimizer (PR #184139)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 08:57:58 PST 2026


================
@@ -196,12 +186,26 @@ struct ARMLoadStoreOpt : public MachineFunctionPass {
   bool CombineMovBx(MachineBasicBlock &MBB);
 };
 
-} // end anonymous namespace
+struct ARMLoadStoreOptLegacy : public MachineFunctionPass {
+  static char ID;
 
-char ARMLoadStoreOpt::ID = 0;
+  ARMLoadStoreOptLegacy() : MachineFunctionPass(ID) {}
 
-INITIALIZE_PASS(ARMLoadStoreOpt, "arm-ldst-opt", ARM_LOAD_STORE_OPT_NAME, false,
-                false)
+  bool runOnMachineFunction(MachineFunction &Fn) override;
+
+  MachineFunctionProperties getRequiredProperties() const override {
+    return MachineFunctionProperties().setNoVRegs();
+  }
+
+  StringRef getPassName() const override { return ARM_LOAD_STORE_OPT_NAME; }
+};
+
+char ARMLoadStoreOptLegacy::ID = 0;
+
+} // end anonymous namespace
+
+INITIALIZE_PASS(ARMLoadStoreOptLegacy, "arm-ldst-opt", ARM_LOAD_STORE_OPT_NAME,
----------------
boomanaiden154 wrote:

Can probably change the name here to `DEBUG_TYPE` to avoid repeating the string constant.

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


More information about the llvm-commits mailing list