[PATCH] D22724: [PM] Significantly refactor the pass pipeline parsing to be easier to reason about and less error prone.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 23 01:41:29 PDT 2016


chandlerc created this revision.
chandlerc added a subscriber: llvm-commits.
chandlerc added a dependency: D22723: [ADT] Add 'consume_front' and 'consume_back' methods to StringRef which are very handy when parsing text..
Herald added a subscriber: mcrosier.

The core idea is to fully parse the text without trying to identify
passes or structure. This is done with a single state machine. There
were various bugs in the logic around this previously that were repeated
and scattered across the code. Having a single routine makes it much
easier to fix and get correct. For example, this routine doesn't suffer
from PR28577.

Then the actual pass construction is handled using *much* easier to read
code and simple loops, with particular pass manager construction sunk to
live with other pass construction. This is especially nice as the pass
managers *are* in fact passes.

Finally, the "implicit" pass manager synthesis is done much more simply
by forming "pre-parsed" structures rather than having to duplicate tons
of logic.

One of the bugs fixed by this was evident in the tests where we accepted
a pipeline that wasn't really well formed. Another bug is PR28577 for
which I have added a test case.

The code is less efficient than the previous code but I'm really hoping
that's not a priority. ;]

Depends on D22723

https://reviews.llvm.org/D22724

Files:
  include/llvm/Passes/PassBuilder.h
  lib/Passes/PassBuilder.cpp
  test/Other/pass-pipeline-parsing.ll
  test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22724.65219.patch
Type: text/x-patch
Size: 26910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160723/04f96cea/attachment.bin>


More information about the llvm-commits mailing list