[PATCH] D59825: SafepointIRVerifier port to new Pass Manager

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 27 23:00:32 PDT 2019


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL357147: SafepointIRVerifier port to new Pass Manager (authored by skatkov, committed by ).
Herald added a project: LLVM.

Changed prior to commit:
  https://reviews.llvm.org/D59825?vs=192405&id=192565#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59825/new/

https://reviews.llvm.org/D59825

Files:
  llvm/trunk/include/llvm/IR/SafepointIRVerifier.h
  llvm/trunk/lib/IR/SafepointIRVerifier.cpp
  llvm/trunk/lib/Passes/PassBuilder.cpp
  llvm/trunk/lib/Passes/PassRegistry.def


Index: llvm/trunk/lib/IR/SafepointIRVerifier.cpp
===================================================================
--- llvm/trunk/lib/IR/SafepointIRVerifier.cpp
+++ llvm/trunk/lib/IR/SafepointIRVerifier.cpp
@@ -197,6 +197,17 @@
 static void Verify(const Function &F, const DominatorTree &DT,
                    const CFGDeadness &CD);
 
+namespace llvm {
+PreservedAnalyses SafepointIRVerifierPass::run(Function &F,
+                                               FunctionAnalysisManager &AM) {
+  const auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
+  CFGDeadness CD;
+  CD.processFunction(F, DT);
+  Verify(F, DT, CD);
+  return PreservedAnalyses::all();
+}
+}
+
 namespace {
 
 struct SafepointIRVerifier : public FunctionPass {
Index: llvm/trunk/lib/Passes/PassBuilder.cpp
===================================================================
--- llvm/trunk/lib/Passes/PassBuilder.cpp
+++ llvm/trunk/lib/Passes/PassBuilder.cpp
@@ -56,6 +56,7 @@
 #include "llvm/IR/Dominators.h"
 #include "llvm/IR/IRPrintingPasses.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/IR/SafepointIRVerifier.h"
 #include "llvm/IR/Verifier.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/FormatVariadic.h"
Index: llvm/trunk/lib/Passes/PassRegistry.def
===================================================================
--- llvm/trunk/lib/Passes/PassRegistry.def
+++ llvm/trunk/lib/Passes/PassRegistry.def
@@ -231,6 +231,7 @@
 FUNCTION_PASS("verify<loops>", LoopVerifierPass())
 FUNCTION_PASS("verify<memoryssa>", MemorySSAVerifierPass())
 FUNCTION_PASS("verify<regions>", RegionInfoVerifierPass())
+FUNCTION_PASS("verify<safepoint-ir>", SafepointIRVerifierPass())
 FUNCTION_PASS("view-cfg", CFGViewerPass())
 FUNCTION_PASS("view-cfg-only", CFGOnlyViewerPass())
 FUNCTION_PASS("transform-warning", WarnMissedTransformationsPass())
Index: llvm/trunk/include/llvm/IR/SafepointIRVerifier.h
===================================================================
--- llvm/trunk/include/llvm/IR/SafepointIRVerifier.h
+++ llvm/trunk/include/llvm/IR/SafepointIRVerifier.h
@@ -29,6 +29,16 @@
 /// Create an instance of the safepoint verifier pass which can be added to
 /// a pass pipeline to check for relocation bugs.
 FunctionPass *createSafepointIRVerifierPass();
+
+/// Create an instance of the safepoint verifier pass which can be added to
+/// a pass pipeline to check for relocation bugs.
+class SafepointIRVerifierPass : public PassInfoMixin<SafepointIRVerifierPass> {
+
+public:
+  explicit SafepointIRVerifierPass() {}
+
+  PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
+};
 }
 
 #endif // LLVM_IR_SAFEPOINT_IR_VERIFIER


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59825.192565.patch
Type: text/x-patch
Size: 2642 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190328/8b2f2f8c/attachment.bin>


More information about the llvm-commits mailing list