[PATCH] D28077: [PM] Introduce options to enable the (still experimental) new pass manager, and a code path to use it.

Chandler Carruth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 23 00:52:40 PST 2016


chandlerc created this revision.
chandlerc added reviewers: rsmith, mehdi_amini.
chandlerc added a subscriber: cfe-commits.
chandlerc added a dependency: D28076: [PM] Add support for building a default AA pipeline to the PassBuilder..
Herald added a subscriber: mcrosier.

The option is actually a top-level option but does contain
'experimental' in the name. This is the compromise suggested by Richard
in discussions. We expect this option will be around long enough and
have enough users towards the end that it merits not being relegated to
CC1, but it still needs to be clear that this option will go away at
some point.

The backend code is a fresh codepath dedicated to handling the flow with
the new pass manager. This was also Richard's suggested code structuring
to essentially leave a clean path for development rather than carrying
complexity or idiosyncracies of how we do things just to share code with
the parts of this in common with the legacy pass manager. And it turns
out, not much is really in common even though we use the legacy pass
manager for codegen at this point.

I've switched a couple of tests to run with the new pass manager, and
they appear to work. There are still plenty of bugs that need squashing
(just with basic experiments I've found two already!) but they aren't in
this code, and the whole point is to expose the necessary hooks to start
experimenting with the pass manager in more realistic scenarios.

That said, I want to *strongly caution* anyone itching to play with
this: it is still *very shaky*. Several large components have not yet
been shaken down. For example I have bugs in both the always inliner and
inliner that I have already spotted and will be fixing independently.

Still, this is a fun milestone. =D

One thing not in this patch (but that might be very reasonable to add)
is some level of support for raw textual pass pipelines such as what
Sean had a patch for some time ago. I'm mostly interested in the more
traditional flow of getting the IR out of Clang and then running it
through opt, but I can see other use cases so someone may want to add
it.

And of course, *many* features are not yet supported!

- https://reviews.llvm.org/owners/package/1/ is currently more like https://reviews.llvm.org/owners/package/2/
- None of the sanitizers are wired up
- ObjC ARC optimizer isn't wired up
- ...

So plenty of stuff still lef to do!

Depends on https://reviews.llvm.org/D28076.


https://reviews.llvm.org/D28077

Files:
  include/clang/Driver/Options.td
  include/clang/Frontend/CodeGenOptions.def
  lib/CodeGen/BackendUtil.cpp
  lib/Driver/Tools.cpp
  lib/Frontend/CompilerInvocation.cpp
  test/CodeGen/arm64_crypto.c
  test/CodeGen/inline-optim.c
  test/Driver/clang_f_opts.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28077.82400.patch
Type: text/x-patch
Size: 12428 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161223/0259dd1b/attachment.bin>


More information about the cfe-commits mailing list