This is an archive of the discontinued LLVM Phabricator instance.

SafepointIRVerifier port to new Pass Manager
ClosedPublic

Authored by skatkov on Mar 26 2019, 9:22 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

skatkov created this revision.Mar 26 2019, 9:22 AM
skatkov added a subscriber: llvm-commits.

Please, update verify-safepoint tests to use new-pass-manager flavor.

include/llvm/IR/SafepointIRVerifier.h
41 ↗(On Diff #192287)

Why do we need Module wrapper for this?
Seems like function pass is enough.

lib/Passes/PassRegistry.def
220 ↗(On Diff #192287)

Just a few lines below there are a handful of verifiers.
They seem to be using a text pipeline format of "verify<something>".

Lets do this as "verify<safepoint-ir>"

(and move it down there)

reames requested changes to this revision.Mar 26 2019, 5:56 PM

Mark to reflect Fedor's comments

This revision now requires changes to proceed.Mar 26 2019, 5:56 PM
skatkov planned changes to this revision.Mar 26 2019, 7:42 PM
skatkov marked 2 inline comments as done.
skatkov added inline comments.
include/llvm/IR/SafepointIRVerifier.h
41 ↗(On Diff #192287)

This is done to similarity to VerifierPass which implements both Module and Function pass functionality. I agree that this pass does not do any verification on Module level but I do not see any issues with keeping both wrappers.

lib/Passes/PassRegistry.def
220 ↗(On Diff #192287)

I preferred to keep the same name as Legacy pass manager used.

skatkov updated this revision to Diff 192405.Mar 26 2019, 8:25 PM

Fedor's comments handled.

fedor.sergeev added inline comments.Mar 26 2019, 11:06 PM
include/llvm/IR/SafepointIRVerifier.h
41 ↗(On Diff #192287)

There is no need for additional wrapper.
We already have module->function adaptors and it applies automatically when you specify

-passes='verify<safepoint-ir>'

So from usability point of view there is no utility in adding this wrapper.

VerifierPass calls verifyModule for Module version and verifyFunction for Function version, so its not just a wrapper.

This revision was not accepted when it landed; it landed in state Needs Review.Mar 27 2019, 11:00 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 27 2019, 11:00 PM

Unfortunately this has introduced a cyclic dependency in the module build graph. Could you please revert the patch to get the bots running again until we figured out a solution?

http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/22548/consoleFull#147888646349ba4694-19c4-4d7e-bec5-911270d8a58c

In file included from <module-includes>:21:
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm/include/llvm/IR/SafepointIRVerifier.h:21:10: fatal error: cyclic dependency in module 'LLVM_intrinsic_gen': LLVM_intrinsic_gen -> LLVM_IR -> LLVM_intrinsic_gen
#include "llvm/IR/PassManager.h"
         ^
While building module 'LLVM_intrinsic_gen' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm/lib/IR/Attributes.cpp:15:
In file included from <module-includes>:1:
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm/include/llvm/IR/Argument.h:19:10: fatal error: could not build module 'LLVM_IR'
#include "llvm/IR/Value.h"
 ~~~~~~~~^~~~~~~~~~~~~~~~~
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm/lib/IR/Attributes.cpp:15:10: fatal error: could not build module 'LLVM_intrinsic_gen'
#include "llvm/IR/Attributes.h"
 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
3 errors generated.

NB: not the patch in this review, but the follow-up patch:

Author: Serguei Katkov <serguei.katkov@azul.com>
Date:   Thu Mar 28 07:02:00 2019 +0000

    SafepointIRVerifier port to new Pass Manager
    
    Add missed include.
    
    llvm-svn: 357148

diff --git a/llvm/include/llvm/IR/SafepointIRVerifier.h b/llvm/include/llvm/IR/SafepointIRVerifier.h
index 2a13bcc92a7..ec5527954ad 100644
--- a/llvm/include/llvm/IR/SafepointIRVerifier.h
+++ b/llvm/include/llvm/IR/SafepointIRVerifier.h
@@ -18,6 +18,8 @@
 #ifndef LLVM_IR_SAFEPOINT_IR_VERIFIER
 #define LLVM_IR_SAFEPOINT_IR_VERIFIER
 
+#include "llvm/IR/PassManager.h"
+
 namespace llvm {
 
 class Function;

I reverted the commit in r357201. Let me know if you need any help resolving the cyclic dependency. (You can reproduce it by cmake-ing with -DLLVM_ENABLE_MODULES=1.)

Thank you for reverting the patch, I'll take a look into this dependency. I'll ping you if I have a trouble in reproducing the crash.

fedor.sergeev added a comment.EditedApr 1 2019, 3:43 AM

Landed the change back, with fixes to module.modulemap. rL357361.

Thanks, and sorry for the extra inconvenience!