[PATCH] D28042: [PM] Introduce a reasonable port of the main per-module pass pipeline from the old pass manager in the new one.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 21 17:54:47 PST 2016


chandlerc created this revision.
chandlerc added a reviewer: mehdi_amini.
chandlerc added a subscriber: llvm-commits.
Herald added subscribers: mzolotukhin, mcrosier, sanjoy.

I'm not trying to support (initially) the numerous options that are
currently available to customize the pass pipeline. If we end up really
wanting them, we can add them later, but I suspect many are no longer
interesting. The simplicity of omitting them will help a lot as we sort
out what the pipeline should look like in the new PM.

I've also documented to the best of my ability *why* each pass or group
of passes is used so that reading the pipeline is more helpful. In many
cases I think we have some questionable choices of ordering and I've
left FIXME comments in place so we know what to come back and revisit
going forward. But for now, I've left it as similar to the current
pipeline as I could.

Lastly, I've had to comment out several places where passes are not
ported to the new pass manager or where the loop pass infrastructure is
not yet ready. I did at least fix a few bugs in the loop pass
infrastructure uncovered by running the full pipeline, but I didn't want
to go too far in this patch -- I'll come back and re-enable these as the
infrastructure comes online. But I'd like to keep the comments in place
because I don't want to lose track of which passes need to be enabled
and where they go.

One thing that seemed like a significant API improvement was to require
that we don't build pipelines for O0. It seems to have no real benefit.

I've also switched back to returning pass managers by value as at this
API layer it feels much more natural to me for composition. But if
others disagree, I'm happy to go back to an output parameter.

I'm not 100% happy with the testing strategy currently, but it seems at
least OK. I may come back and try to refactor or otherwise improve this
in subsequent patches but I wanted to at least get a good starting point
in place.


https://reviews.llvm.org/D28042

Files:
  include/llvm/Analysis/LoopPassManager.h
  include/llvm/Passes/PassBuilder.h
  include/llvm/Transforms/Scalar/LoopRotation.h
  lib/Analysis/LoopPassManager.cpp
  lib/Passes/PassBuilder.cpp
  lib/Transforms/Scalar/LoopRotation.cpp
  test/Other/new-pass-manager.ll
  unittests/Analysis/LoopPassManagerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28042.82298.patch
Type: text/x-patch
Size: 28749 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161222/f7b6ae7f/attachment.bin>


More information about the llvm-commits mailing list