[llvm] [Reg2Mem] Add legacy pass wrapping Reg2Mem (PR #111024)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 3 12:51:09 PDT 2024


Nathan =?utf-8?q?Gau=C3=ABr?= <brioche at google.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/111024 at github.com>


================
@@ -22,6 +26,27 @@ class RegToMemPass : public PassInfoMixin<RegToMemPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
+class RegToMemWrapperPass : public FunctionPass {
+public:
+  static char ID;
+
+  RegToMemWrapperPass();
+
+  void getAnalysisUsage(AnalysisUsage &AU) const override {
+    AU.setPreservesAll();
+
+    AU.addPreserved<DominatorTreeWrapperPass>();
+    AU.addRequired<DominatorTreeWrapperPass>();
+
+    AU.addPreserved<LoopInfoWrapperPass>();
+    AU.addRequired<LoopInfoWrapperPass>();
+  }
----------------
nikic wrote:

Move this into the cpp file and remove related includes.

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


More information about the llvm-commits mailing list