[llvm-dev] migrating out-of-source passes to new PassManager?

Christian Convey via llvm-dev llvm-dev at lists.llvm.org
Mon Jun 5 10:19:47 PDT 2017


I've got some out-of-source passes which were written before the new
PassManager was a thing.

I'm trying to get them to build and run properly, with a minimum of
effort.  I'm willing to use the Legacy PassManager only, even if that's a
crutch that will eventually go away.

Unfortunately I'm hitting some speed-bumps:

   - I can't find any documentation giving an overview of how the new
   PassManager is supposed to be used.  This tutorial
   <http://llvm.org/docs/WritingAnLLVMPass.html> seems out of date.

   - I've looked at how some other passes were ported to the new
   PassManager, for example: here <https://reviews.llvm.org/D24592>.
   However, it's not really clear how closely they match my situation:
      - They're in-source, but my passes are out-of-source.

      - They seem to cater to both the new and legacy PassManagers.  It's
      not clear if a Pass needs to interact with *both* of those pass
      managers if the only goal is to use the legacy one.

      - I'm getting failed asserts from LLVM when using
      `AAResultsWrapperPass`, but I can't figure out what I'm doing wrong:

Assertion `ResultPass && "getAnalysis*() called on an analysis that was not
" "'required' by pass!"' failed.

​(Bear in mind that this code worked fine with LLVM 3.7.  All of the old
"AU.addRequired<...>()" calls are still there, although I've changed the
AA-provider to "AAResultsWrapperPass".)


Can anyone suggest good sources of info for what I'm trying to do?

Cheers,
Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170605/a5d66b21/attachment.html>


More information about the llvm-dev mailing list