2014-01-11 20:06:47 +08:00
|
|
|
; RUN: opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes=no-op-module,no-op-module %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-TWO-NOOP-MP
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-TWO-NOOP-MP: Starting llvm::Module pass manager run
|
2015-01-13 19:13:56 +08:00
|
|
|
; CHECK-TWO-NOOP-MP: Running pass: NoOpModulePass
|
|
|
|
; CHECK-TWO-NOOP-MP: Running pass: NoOpModulePass
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-TWO-NOOP-MP: Finished llvm::Module pass manager run
|
2014-01-11 20:06:47 +08:00
|
|
|
|
|
|
|
; RUN: opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='module(no-op-module,no-op-module)' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-NESTED-TWO-NOOP-MP
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-NESTED-TWO-NOOP-MP: Starting llvm::Module pass manager run
|
2015-01-13 19:13:56 +08:00
|
|
|
; CHECK-NESTED-TWO-NOOP-MP: Running pass: NoOpModulePass
|
|
|
|
; CHECK-NESTED-TWO-NOOP-MP: Running pass: NoOpModulePass
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-NESTED-TWO-NOOP-MP: Finished llvm::Module pass manager run
|
2014-01-12 17:34:22 +08:00
|
|
|
|
|
|
|
; RUN: opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes=no-op-function,no-op-function %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-TWO-NOOP-FP
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-TWO-NOOP-FP: Starting llvm::Module pass manager run
|
|
|
|
; CHECK-TWO-NOOP-FP: Starting llvm::Function pass manager run
|
2015-01-13 19:13:56 +08:00
|
|
|
; CHECK-TWO-NOOP-FP: Running pass: NoOpFunctionPass
|
|
|
|
; CHECK-TWO-NOOP-FP: Running pass: NoOpFunctionPass
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-TWO-NOOP-FP: Finished llvm::Function pass manager run
|
|
|
|
; CHECK-TWO-NOOP-FP: Finished llvm::Module pass manager run
|
2014-01-12 17:34:22 +08:00
|
|
|
|
|
|
|
; RUN: opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='function(no-op-function,no-op-function)' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-NESTED-TWO-NOOP-FP
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-NESTED-TWO-NOOP-FP: Starting llvm::Module pass manager run
|
|
|
|
; CHECK-NESTED-TWO-NOOP-FP: Starting llvm::Function pass manager run
|
2015-01-13 19:13:56 +08:00
|
|
|
; CHECK-NESTED-TWO-NOOP-FP: Running pass: NoOpFunctionPass
|
|
|
|
; CHECK-NESTED-TWO-NOOP-FP: Running pass: NoOpFunctionPass
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-NESTED-TWO-NOOP-FP: Finished llvm::Function pass manager run
|
|
|
|
; CHECK-NESTED-TWO-NOOP-FP: Finished llvm::Module pass manager run
|
2014-01-12 17:34:22 +08:00
|
|
|
|
|
|
|
; RUN: opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='no-op-module,function(no-op-function,no-op-function),no-op-module' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-MIXED-FP-AND-MP
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-MIXED-FP-AND-MP: Starting llvm::Module pass manager run
|
2015-01-13 19:13:56 +08:00
|
|
|
; CHECK-MIXED-FP-AND-MP: Running pass: NoOpModulePass
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-MIXED-FP-AND-MP: Starting llvm::Function pass manager run
|
2015-01-13 19:13:56 +08:00
|
|
|
; CHECK-MIXED-FP-AND-MP: Running pass: NoOpFunctionPass
|
|
|
|
; CHECK-MIXED-FP-AND-MP: Running pass: NoOpFunctionPass
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-MIXED-FP-AND-MP: Finished llvm::Function pass manager run
|
2015-01-13 19:13:56 +08:00
|
|
|
; CHECK-MIXED-FP-AND-MP: Running pass: NoOpModulePass
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-MIXED-FP-AND-MP: Finished llvm::Module pass manager run
|
2014-01-12 17:34:22 +08:00
|
|
|
|
2014-01-12 18:02:02 +08:00
|
|
|
; RUN: not opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='no-op-module)' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-UNBALANCED1
|
2018-10-17 18:36:23 +08:00
|
|
|
; CHECK-UNBALANCED1: invalid pipeline 'no-op-module)'
|
2014-01-12 18:02:02 +08:00
|
|
|
|
|
|
|
; RUN: not opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='module(no-op-module))' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-UNBALANCED2
|
2018-10-17 18:36:23 +08:00
|
|
|
; CHECK-UNBALANCED2: invalid pipeline 'module(no-op-module))'
|
2014-01-12 18:02:02 +08:00
|
|
|
|
|
|
|
; RUN: not opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='module(no-op-module' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-UNBALANCED3
|
2018-10-17 18:36:23 +08:00
|
|
|
; CHECK-UNBALANCED3: invalid pipeline 'module(no-op-module'
|
2014-01-12 18:02:02 +08:00
|
|
|
|
|
|
|
; RUN: not opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='no-op-function)' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-UNBALANCED4
|
2018-10-17 18:36:23 +08:00
|
|
|
; CHECK-UNBALANCED4: invalid pipeline 'no-op-function)'
|
2014-01-12 18:02:02 +08:00
|
|
|
|
|
|
|
; RUN: not opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='function(no-op-function))' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-UNBALANCED5
|
2018-10-17 18:36:23 +08:00
|
|
|
; CHECK-UNBALANCED5: invalid pipeline 'function(no-op-function))'
|
2014-01-12 18:02:02 +08:00
|
|
|
|
|
|
|
; RUN: not opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='function(function(no-op-function)))' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-UNBALANCED6
|
2018-10-17 18:36:23 +08:00
|
|
|
; CHECK-UNBALANCED6: invalid pipeline 'function(function(no-op-function)))'
|
2014-01-12 18:02:02 +08:00
|
|
|
|
|
|
|
; RUN: not opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='function(no-op-function' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-UNBALANCED7
|
2018-10-17 18:36:23 +08:00
|
|
|
; CHECK-UNBALANCED7: invalid pipeline 'function(no-op-function'
|
2014-01-12 18:02:02 +08:00
|
|
|
|
|
|
|
; RUN: not opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='function(function(no-op-function)' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-UNBALANCED8
|
2018-10-17 18:36:23 +08:00
|
|
|
; CHECK-UNBALANCED8: invalid pipeline 'function(function(no-op-function)'
|
2014-01-12 18:02:02 +08:00
|
|
|
|
|
|
|
; RUN: not opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='no-op-module,)' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-UNBALANCED9
|
2018-10-17 18:36:23 +08:00
|
|
|
; CHECK-UNBALANCED9: invalid pipeline 'no-op-module,)'
|
2014-01-12 18:02:02 +08:00
|
|
|
|
|
|
|
; RUN: not opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='no-op-function,)' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-UNBALANCED10
|
2018-10-17 18:36:23 +08:00
|
|
|
; CHECK-UNBALANCED10: invalid pipeline 'no-op-function,)'
|
2014-01-12 18:02:02 +08:00
|
|
|
|
2015-01-14 06:45:13 +08:00
|
|
|
; RUN: opt -disable-output -debug-pass-manager \
|
2014-04-21 19:12:00 +08:00
|
|
|
; RUN: -passes=no-op-cgscc,no-op-cgscc %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-TWO-NOOP-CG
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-TWO-NOOP-CG: Starting llvm::Module pass manager run
|
[PM] Introduce basic update capabilities to the new PM's CGSCC pass
manager, including both plumbing and logic to handle function pass
updates.
There are three fundamentally tied changes here:
1) Plumbing *some* mechanism for updating the CGSCC pass manager as the
CG changes while passes are running.
2) Changing the CGSCC pass manager infrastructure to have support for
the underlying graph to mutate mid-pass run.
3) Actually updating the CG after function passes run.
I can separate them if necessary, but I think its really useful to have
them together as the needs of #3 drove #2, and that in turn drove #1.
The plumbing technique is to extend the "run" method signature with
extra arguments. We provide the call graph that intrinsically is
available as it is the basis of the pass manager's IR units, and an
output parameter that records the results of updating the call graph
during an SCC passes's run. Note that "...UpdateResult" isn't a *great*
name here... suggestions very welcome.
I tried a pretty frustrating number of different data structures and such
for the innards of the update result. Every other one failed for one
reason or another. Sometimes I just couldn't keep the layers of
complexity right in my head. The thing that really worked was to just
directly provide access to the underlying structures used to walk the
call graph so that their updates could be informed by the *particular*
nature of the change to the graph.
The technique for how to make the pass management infrastructure cope
with mutating graphs was also something that took a really, really large
number of iterations to get to a place where I was happy. Here are some
of the considerations that drove the design:
- We operate at three levels within the infrastructure: RefSCC, SCC, and
Node. In each case, we are working bottom up and so we want to
continue to iterate on the "lowest" node as the graph changes. Look at
how we iterate over nodes in an SCC running function passes as those
function passes mutate the CG. We continue to iterate on the "lowest"
SCC, which is the one that continues to contain the function just
processed.
- The call graph structure re-uses SCCs (and RefSCCs) during mutation
events for the *highest* entry in the resulting new subgraph, not the
lowest. This means that it is necessary to continually update the
current SCC or RefSCC as it shifts. This is really surprising and
subtle, and took a long time for me to work out. I actually tried
changing the call graph to provide the opposite behavior, and it
breaks *EVERYTHING*. The graph update algorithms are really deeply
tied to this particualr pattern.
- When SCCs or RefSCCs are split apart and refined and we continually
re-pin our processing to the bottom one in the subgraph, we need to
enqueue the newly formed SCCs and RefSCCs for subsequent processing.
Queuing them presents a few challenges:
1) SCCs and RefSCCs use wildly different iteration strategies at
a high level. We end up needing to converge them on worklist
approaches that can be extended in order to be able to handle the
mutations.
2) The order of the enqueuing need to remain bottom-up post-order so
that we don't get surprising order of visitation for things like
the inliner.
3) We need the worklists to have set semantics so we don't duplicate
things endlessly. We don't need a *persistent* set though because
we always keep processing the bottom node!!!! This is super, super
surprising to me and took a long time to convince myself this is
correct, but I'm pretty sure it is... Once we sink down to the
bottom node, we can't re-split out the same node in any way, and
the postorder of the current queue is fixed and unchanging.
4) We need to make sure that the "current" SCC or RefSCC actually gets
enqueued here such that we re-visit it because we continue
processing a *new*, *bottom* SCC/RefSCC.
- We also need the ability to *skip* SCCs and RefSCCs that get merged
into a larger component. We even need the ability to skip *nodes* from
an SCC that are no longer part of that SCC.
This led to the design you see in the patch which uses SetVector-based
worklists. The RefSCC worklist is always empty until an update occurs
and is just used to handle those RefSCCs created by updates as the
others don't even exist yet and are formed on-demand during the
bottom-up walk. The SCC worklist is pre-populated from the RefSCC, and
we push new SCCs onto it and blacklist existing SCCs on it to get the
desired processing.
We then *directly* update these when updating the call graph as I was
never able to find a satisfactory abstraction around the update
strategy.
Finally, we need to compute the updates for function passes. This is
mostly used as an initial customer of all the update mechanisms to drive
their design to at least cover some real set of use cases. There are
a bunch of interesting things that came out of doing this:
- It is really nice to do this a function at a time because that
function is likely hot in the cache. This means we want even the
function pass adaptor to support online updates to the call graph!
- To update the call graph after arbitrary function pass mutations is
quite hard. We have to build a fairly comprehensive set of
data structures and then process them. Fortunately, some of this code
is related to the code for building the cal graph in the first place.
Unfortunately, very little of it makes any sense to share because the
nature of what we're doing is so very different. I've factored out the
one part that made sense at least.
- We need to transfer these updates into the various structures for the
CGSCC pass manager. Once those were more sanely worked out, this
became relatively easier. But some of those needs necessitated changes
to the LazyCallGraph interface to make it significantly easier to
extract the changed SCCs from an update operation.
- We also need to update the CGSCC analysis manager as the shape of the
graph changes. When an SCC is merged away we need to clear analyses
associated with it from the analysis manager which we didn't have
support for in the analysis manager infrsatructure. New SCCs are easy!
But then we have the case that the original SCC has its shape changed
but remains in the call graph. There we need to *invalidate* the
analyses associated with it.
- We also need to invalidate analyses after we *finish* processing an
SCC. But the analyses we need to invalidate here are *only those for
the newly updated SCC*!!! Because we only continue processing the
bottom SCC, if we split SCCs apart the original one gets invalidated
once when its shape changes and is not processed farther so its
analyses will be correct. It is the bottom SCC which continues being
processed and needs to have the "normal" invalidation done based on
the preserved analyses set.
All of this is mostly background and context for the changes here.
Many thanks to all the reviewers who helped here. Especially Sanjoy who
caught several interesting bugs in the graph algorithms, David, Sean,
and others who all helped with feedback.
Differential Revision: http://reviews.llvm.org/D21464
llvm-svn: 279618
2016-08-24 17:37:14 +08:00
|
|
|
; CHECK-TWO-NOOP-CG: Starting CGSCC pass manager run
|
2015-01-13 19:13:56 +08:00
|
|
|
; CHECK-TWO-NOOP-CG: Running pass: NoOpCGSCCPass
|
|
|
|
; CHECK-TWO-NOOP-CG: Running pass: NoOpCGSCCPass
|
[PM] Introduce basic update capabilities to the new PM's CGSCC pass
manager, including both plumbing and logic to handle function pass
updates.
There are three fundamentally tied changes here:
1) Plumbing *some* mechanism for updating the CGSCC pass manager as the
CG changes while passes are running.
2) Changing the CGSCC pass manager infrastructure to have support for
the underlying graph to mutate mid-pass run.
3) Actually updating the CG after function passes run.
I can separate them if necessary, but I think its really useful to have
them together as the needs of #3 drove #2, and that in turn drove #1.
The plumbing technique is to extend the "run" method signature with
extra arguments. We provide the call graph that intrinsically is
available as it is the basis of the pass manager's IR units, and an
output parameter that records the results of updating the call graph
during an SCC passes's run. Note that "...UpdateResult" isn't a *great*
name here... suggestions very welcome.
I tried a pretty frustrating number of different data structures and such
for the innards of the update result. Every other one failed for one
reason or another. Sometimes I just couldn't keep the layers of
complexity right in my head. The thing that really worked was to just
directly provide access to the underlying structures used to walk the
call graph so that their updates could be informed by the *particular*
nature of the change to the graph.
The technique for how to make the pass management infrastructure cope
with mutating graphs was also something that took a really, really large
number of iterations to get to a place where I was happy. Here are some
of the considerations that drove the design:
- We operate at three levels within the infrastructure: RefSCC, SCC, and
Node. In each case, we are working bottom up and so we want to
continue to iterate on the "lowest" node as the graph changes. Look at
how we iterate over nodes in an SCC running function passes as those
function passes mutate the CG. We continue to iterate on the "lowest"
SCC, which is the one that continues to contain the function just
processed.
- The call graph structure re-uses SCCs (and RefSCCs) during mutation
events for the *highest* entry in the resulting new subgraph, not the
lowest. This means that it is necessary to continually update the
current SCC or RefSCC as it shifts. This is really surprising and
subtle, and took a long time for me to work out. I actually tried
changing the call graph to provide the opposite behavior, and it
breaks *EVERYTHING*. The graph update algorithms are really deeply
tied to this particualr pattern.
- When SCCs or RefSCCs are split apart and refined and we continually
re-pin our processing to the bottom one in the subgraph, we need to
enqueue the newly formed SCCs and RefSCCs for subsequent processing.
Queuing them presents a few challenges:
1) SCCs and RefSCCs use wildly different iteration strategies at
a high level. We end up needing to converge them on worklist
approaches that can be extended in order to be able to handle the
mutations.
2) The order of the enqueuing need to remain bottom-up post-order so
that we don't get surprising order of visitation for things like
the inliner.
3) We need the worklists to have set semantics so we don't duplicate
things endlessly. We don't need a *persistent* set though because
we always keep processing the bottom node!!!! This is super, super
surprising to me and took a long time to convince myself this is
correct, but I'm pretty sure it is... Once we sink down to the
bottom node, we can't re-split out the same node in any way, and
the postorder of the current queue is fixed and unchanging.
4) We need to make sure that the "current" SCC or RefSCC actually gets
enqueued here such that we re-visit it because we continue
processing a *new*, *bottom* SCC/RefSCC.
- We also need the ability to *skip* SCCs and RefSCCs that get merged
into a larger component. We even need the ability to skip *nodes* from
an SCC that are no longer part of that SCC.
This led to the design you see in the patch which uses SetVector-based
worklists. The RefSCC worklist is always empty until an update occurs
and is just used to handle those RefSCCs created by updates as the
others don't even exist yet and are formed on-demand during the
bottom-up walk. The SCC worklist is pre-populated from the RefSCC, and
we push new SCCs onto it and blacklist existing SCCs on it to get the
desired processing.
We then *directly* update these when updating the call graph as I was
never able to find a satisfactory abstraction around the update
strategy.
Finally, we need to compute the updates for function passes. This is
mostly used as an initial customer of all the update mechanisms to drive
their design to at least cover some real set of use cases. There are
a bunch of interesting things that came out of doing this:
- It is really nice to do this a function at a time because that
function is likely hot in the cache. This means we want even the
function pass adaptor to support online updates to the call graph!
- To update the call graph after arbitrary function pass mutations is
quite hard. We have to build a fairly comprehensive set of
data structures and then process them. Fortunately, some of this code
is related to the code for building the cal graph in the first place.
Unfortunately, very little of it makes any sense to share because the
nature of what we're doing is so very different. I've factored out the
one part that made sense at least.
- We need to transfer these updates into the various structures for the
CGSCC pass manager. Once those were more sanely worked out, this
became relatively easier. But some of those needs necessitated changes
to the LazyCallGraph interface to make it significantly easier to
extract the changed SCCs from an update operation.
- We also need to update the CGSCC analysis manager as the shape of the
graph changes. When an SCC is merged away we need to clear analyses
associated with it from the analysis manager which we didn't have
support for in the analysis manager infrsatructure. New SCCs are easy!
But then we have the case that the original SCC has its shape changed
but remains in the call graph. There we need to *invalidate* the
analyses associated with it.
- We also need to invalidate analyses after we *finish* processing an
SCC. But the analyses we need to invalidate here are *only those for
the newly updated SCC*!!! Because we only continue processing the
bottom SCC, if we split SCCs apart the original one gets invalidated
once when its shape changes and is not processed farther so its
analyses will be correct. It is the bottom SCC which continues being
processed and needs to have the "normal" invalidation done based on
the preserved analyses set.
All of this is mostly background and context for the changes here.
Many thanks to all the reviewers who helped here. Especially Sanjoy who
caught several interesting bugs in the graph algorithms, David, Sean,
and others who all helped with feedback.
Differential Revision: http://reviews.llvm.org/D21464
llvm-svn: 279618
2016-08-24 17:37:14 +08:00
|
|
|
; CHECK-TWO-NOOP-CG: Finished CGSCC pass manager run
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-TWO-NOOP-CG: Finished llvm::Module pass manager run
|
2014-04-21 19:12:00 +08:00
|
|
|
|
2015-01-14 06:45:13 +08:00
|
|
|
; RUN: opt -disable-output -debug-pass-manager \
|
2014-04-21 19:12:00 +08:00
|
|
|
; RUN: -passes='module(function(no-op-function),cgscc(no-op-cgscc,function(no-op-function),no-op-cgscc),function(no-op-function))' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-NESTED-MP-CG-FP
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-NESTED-MP-CG-FP: Starting llvm::Module pass manager run
|
|
|
|
; CHECK-NESTED-MP-CG-FP: Starting llvm::Function pass manager run
|
2015-01-13 19:13:56 +08:00
|
|
|
; CHECK-NESTED-MP-CG-FP: Running pass: NoOpFunctionPass
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-NESTED-MP-CG-FP: Finished llvm::Function pass manager run
|
[PM] Introduce basic update capabilities to the new PM's CGSCC pass
manager, including both plumbing and logic to handle function pass
updates.
There are three fundamentally tied changes here:
1) Plumbing *some* mechanism for updating the CGSCC pass manager as the
CG changes while passes are running.
2) Changing the CGSCC pass manager infrastructure to have support for
the underlying graph to mutate mid-pass run.
3) Actually updating the CG after function passes run.
I can separate them if necessary, but I think its really useful to have
them together as the needs of #3 drove #2, and that in turn drove #1.
The plumbing technique is to extend the "run" method signature with
extra arguments. We provide the call graph that intrinsically is
available as it is the basis of the pass manager's IR units, and an
output parameter that records the results of updating the call graph
during an SCC passes's run. Note that "...UpdateResult" isn't a *great*
name here... suggestions very welcome.
I tried a pretty frustrating number of different data structures and such
for the innards of the update result. Every other one failed for one
reason or another. Sometimes I just couldn't keep the layers of
complexity right in my head. The thing that really worked was to just
directly provide access to the underlying structures used to walk the
call graph so that their updates could be informed by the *particular*
nature of the change to the graph.
The technique for how to make the pass management infrastructure cope
with mutating graphs was also something that took a really, really large
number of iterations to get to a place where I was happy. Here are some
of the considerations that drove the design:
- We operate at three levels within the infrastructure: RefSCC, SCC, and
Node. In each case, we are working bottom up and so we want to
continue to iterate on the "lowest" node as the graph changes. Look at
how we iterate over nodes in an SCC running function passes as those
function passes mutate the CG. We continue to iterate on the "lowest"
SCC, which is the one that continues to contain the function just
processed.
- The call graph structure re-uses SCCs (and RefSCCs) during mutation
events for the *highest* entry in the resulting new subgraph, not the
lowest. This means that it is necessary to continually update the
current SCC or RefSCC as it shifts. This is really surprising and
subtle, and took a long time for me to work out. I actually tried
changing the call graph to provide the opposite behavior, and it
breaks *EVERYTHING*. The graph update algorithms are really deeply
tied to this particualr pattern.
- When SCCs or RefSCCs are split apart and refined and we continually
re-pin our processing to the bottom one in the subgraph, we need to
enqueue the newly formed SCCs and RefSCCs for subsequent processing.
Queuing them presents a few challenges:
1) SCCs and RefSCCs use wildly different iteration strategies at
a high level. We end up needing to converge them on worklist
approaches that can be extended in order to be able to handle the
mutations.
2) The order of the enqueuing need to remain bottom-up post-order so
that we don't get surprising order of visitation for things like
the inliner.
3) We need the worklists to have set semantics so we don't duplicate
things endlessly. We don't need a *persistent* set though because
we always keep processing the bottom node!!!! This is super, super
surprising to me and took a long time to convince myself this is
correct, but I'm pretty sure it is... Once we sink down to the
bottom node, we can't re-split out the same node in any way, and
the postorder of the current queue is fixed and unchanging.
4) We need to make sure that the "current" SCC or RefSCC actually gets
enqueued here such that we re-visit it because we continue
processing a *new*, *bottom* SCC/RefSCC.
- We also need the ability to *skip* SCCs and RefSCCs that get merged
into a larger component. We even need the ability to skip *nodes* from
an SCC that are no longer part of that SCC.
This led to the design you see in the patch which uses SetVector-based
worklists. The RefSCC worklist is always empty until an update occurs
and is just used to handle those RefSCCs created by updates as the
others don't even exist yet and are formed on-demand during the
bottom-up walk. The SCC worklist is pre-populated from the RefSCC, and
we push new SCCs onto it and blacklist existing SCCs on it to get the
desired processing.
We then *directly* update these when updating the call graph as I was
never able to find a satisfactory abstraction around the update
strategy.
Finally, we need to compute the updates for function passes. This is
mostly used as an initial customer of all the update mechanisms to drive
their design to at least cover some real set of use cases. There are
a bunch of interesting things that came out of doing this:
- It is really nice to do this a function at a time because that
function is likely hot in the cache. This means we want even the
function pass adaptor to support online updates to the call graph!
- To update the call graph after arbitrary function pass mutations is
quite hard. We have to build a fairly comprehensive set of
data structures and then process them. Fortunately, some of this code
is related to the code for building the cal graph in the first place.
Unfortunately, very little of it makes any sense to share because the
nature of what we're doing is so very different. I've factored out the
one part that made sense at least.
- We need to transfer these updates into the various structures for the
CGSCC pass manager. Once those were more sanely worked out, this
became relatively easier. But some of those needs necessitated changes
to the LazyCallGraph interface to make it significantly easier to
extract the changed SCCs from an update operation.
- We also need to update the CGSCC analysis manager as the shape of the
graph changes. When an SCC is merged away we need to clear analyses
associated with it from the analysis manager which we didn't have
support for in the analysis manager infrsatructure. New SCCs are easy!
But then we have the case that the original SCC has its shape changed
but remains in the call graph. There we need to *invalidate* the
analyses associated with it.
- We also need to invalidate analyses after we *finish* processing an
SCC. But the analyses we need to invalidate here are *only those for
the newly updated SCC*!!! Because we only continue processing the
bottom SCC, if we split SCCs apart the original one gets invalidated
once when its shape changes and is not processed farther so its
analyses will be correct. It is the bottom SCC which continues being
processed and needs to have the "normal" invalidation done based on
the preserved analyses set.
All of this is mostly background and context for the changes here.
Many thanks to all the reviewers who helped here. Especially Sanjoy who
caught several interesting bugs in the graph algorithms, David, Sean,
and others who all helped with feedback.
Differential Revision: http://reviews.llvm.org/D21464
llvm-svn: 279618
2016-08-24 17:37:14 +08:00
|
|
|
; CHECK-NESTED-MP-CG-FP: Starting CGSCC pass manager run
|
2015-01-13 19:13:56 +08:00
|
|
|
; CHECK-NESTED-MP-CG-FP: Running pass: NoOpCGSCCPass
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-NESTED-MP-CG-FP: Starting llvm::Function pass manager run
|
2015-01-13 19:13:56 +08:00
|
|
|
; CHECK-NESTED-MP-CG-FP: Running pass: NoOpFunctionPass
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-NESTED-MP-CG-FP: Finished llvm::Function pass manager run
|
2015-01-13 19:13:56 +08:00
|
|
|
; CHECK-NESTED-MP-CG-FP: Running pass: NoOpCGSCCPass
|
[PM] Introduce basic update capabilities to the new PM's CGSCC pass
manager, including both plumbing and logic to handle function pass
updates.
There are three fundamentally tied changes here:
1) Plumbing *some* mechanism for updating the CGSCC pass manager as the
CG changes while passes are running.
2) Changing the CGSCC pass manager infrastructure to have support for
the underlying graph to mutate mid-pass run.
3) Actually updating the CG after function passes run.
I can separate them if necessary, but I think its really useful to have
them together as the needs of #3 drove #2, and that in turn drove #1.
The plumbing technique is to extend the "run" method signature with
extra arguments. We provide the call graph that intrinsically is
available as it is the basis of the pass manager's IR units, and an
output parameter that records the results of updating the call graph
during an SCC passes's run. Note that "...UpdateResult" isn't a *great*
name here... suggestions very welcome.
I tried a pretty frustrating number of different data structures and such
for the innards of the update result. Every other one failed for one
reason or another. Sometimes I just couldn't keep the layers of
complexity right in my head. The thing that really worked was to just
directly provide access to the underlying structures used to walk the
call graph so that their updates could be informed by the *particular*
nature of the change to the graph.
The technique for how to make the pass management infrastructure cope
with mutating graphs was also something that took a really, really large
number of iterations to get to a place where I was happy. Here are some
of the considerations that drove the design:
- We operate at three levels within the infrastructure: RefSCC, SCC, and
Node. In each case, we are working bottom up and so we want to
continue to iterate on the "lowest" node as the graph changes. Look at
how we iterate over nodes in an SCC running function passes as those
function passes mutate the CG. We continue to iterate on the "lowest"
SCC, which is the one that continues to contain the function just
processed.
- The call graph structure re-uses SCCs (and RefSCCs) during mutation
events for the *highest* entry in the resulting new subgraph, not the
lowest. This means that it is necessary to continually update the
current SCC or RefSCC as it shifts. This is really surprising and
subtle, and took a long time for me to work out. I actually tried
changing the call graph to provide the opposite behavior, and it
breaks *EVERYTHING*. The graph update algorithms are really deeply
tied to this particualr pattern.
- When SCCs or RefSCCs are split apart and refined and we continually
re-pin our processing to the bottom one in the subgraph, we need to
enqueue the newly formed SCCs and RefSCCs for subsequent processing.
Queuing them presents a few challenges:
1) SCCs and RefSCCs use wildly different iteration strategies at
a high level. We end up needing to converge them on worklist
approaches that can be extended in order to be able to handle the
mutations.
2) The order of the enqueuing need to remain bottom-up post-order so
that we don't get surprising order of visitation for things like
the inliner.
3) We need the worklists to have set semantics so we don't duplicate
things endlessly. We don't need a *persistent* set though because
we always keep processing the bottom node!!!! This is super, super
surprising to me and took a long time to convince myself this is
correct, but I'm pretty sure it is... Once we sink down to the
bottom node, we can't re-split out the same node in any way, and
the postorder of the current queue is fixed and unchanging.
4) We need to make sure that the "current" SCC or RefSCC actually gets
enqueued here such that we re-visit it because we continue
processing a *new*, *bottom* SCC/RefSCC.
- We also need the ability to *skip* SCCs and RefSCCs that get merged
into a larger component. We even need the ability to skip *nodes* from
an SCC that are no longer part of that SCC.
This led to the design you see in the patch which uses SetVector-based
worklists. The RefSCC worklist is always empty until an update occurs
and is just used to handle those RefSCCs created by updates as the
others don't even exist yet and are formed on-demand during the
bottom-up walk. The SCC worklist is pre-populated from the RefSCC, and
we push new SCCs onto it and blacklist existing SCCs on it to get the
desired processing.
We then *directly* update these when updating the call graph as I was
never able to find a satisfactory abstraction around the update
strategy.
Finally, we need to compute the updates for function passes. This is
mostly used as an initial customer of all the update mechanisms to drive
their design to at least cover some real set of use cases. There are
a bunch of interesting things that came out of doing this:
- It is really nice to do this a function at a time because that
function is likely hot in the cache. This means we want even the
function pass adaptor to support online updates to the call graph!
- To update the call graph after arbitrary function pass mutations is
quite hard. We have to build a fairly comprehensive set of
data structures and then process them. Fortunately, some of this code
is related to the code for building the cal graph in the first place.
Unfortunately, very little of it makes any sense to share because the
nature of what we're doing is so very different. I've factored out the
one part that made sense at least.
- We need to transfer these updates into the various structures for the
CGSCC pass manager. Once those were more sanely worked out, this
became relatively easier. But some of those needs necessitated changes
to the LazyCallGraph interface to make it significantly easier to
extract the changed SCCs from an update operation.
- We also need to update the CGSCC analysis manager as the shape of the
graph changes. When an SCC is merged away we need to clear analyses
associated with it from the analysis manager which we didn't have
support for in the analysis manager infrsatructure. New SCCs are easy!
But then we have the case that the original SCC has its shape changed
but remains in the call graph. There we need to *invalidate* the
analyses associated with it.
- We also need to invalidate analyses after we *finish* processing an
SCC. But the analyses we need to invalidate here are *only those for
the newly updated SCC*!!! Because we only continue processing the
bottom SCC, if we split SCCs apart the original one gets invalidated
once when its shape changes and is not processed farther so its
analyses will be correct. It is the bottom SCC which continues being
processed and needs to have the "normal" invalidation done based on
the preserved analyses set.
All of this is mostly background and context for the changes here.
Many thanks to all the reviewers who helped here. Especially Sanjoy who
caught several interesting bugs in the graph algorithms, David, Sean,
and others who all helped with feedback.
Differential Revision: http://reviews.llvm.org/D21464
llvm-svn: 279618
2016-08-24 17:37:14 +08:00
|
|
|
; CHECK-NESTED-MP-CG-FP: Finished CGSCC pass manager run
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-NESTED-MP-CG-FP: Starting llvm::Function pass manager run
|
2015-01-13 19:13:56 +08:00
|
|
|
; CHECK-NESTED-MP-CG-FP: Running pass: NoOpFunctionPass
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-NESTED-MP-CG-FP: Finished llvm::Function pass manager run
|
|
|
|
; CHECK-NESTED-MP-CG-FP: Finished llvm::Module pass manager run
|
2014-04-21 19:12:00 +08:00
|
|
|
|
2016-02-25 15:23:08 +08:00
|
|
|
; RUN: opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='no-op-loop,no-op-loop' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-TWO-NOOP-LOOP
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-TWO-NOOP-LOOP: Starting llvm::Module pass manager run
|
|
|
|
; CHECK-TWO-NOOP-LOOP: Starting llvm::Function pass manager run
|
2017-01-11 14:23:21 +08:00
|
|
|
; CHECK-TWO-NOOP-LOOP: Starting Loop pass manager run
|
2016-02-25 15:23:08 +08:00
|
|
|
; CHECK-TWO-NOOP-LOOP: Running pass: NoOpLoopPass
|
|
|
|
; CHECK-TWO-NOOP-LOOP: Running pass: NoOpLoopPass
|
2017-01-11 14:23:21 +08:00
|
|
|
; CHECK-TWO-NOOP-LOOP: Finished Loop pass manager run
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-TWO-NOOP-LOOP: Finished llvm::Function pass manager run
|
|
|
|
; CHECK-TWO-NOOP-LOOP: Finished llvm::Module pass manager run
|
2016-02-25 15:23:08 +08:00
|
|
|
|
|
|
|
; RUN: opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='module(function(loop(no-op-loop)))' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-NESTED-FP-LP
|
|
|
|
; RUN: opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='function(loop(no-op-loop))' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-NESTED-FP-LP
|
|
|
|
; RUN: opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='loop(no-op-loop)' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-NESTED-FP-LP
|
|
|
|
; RUN: opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='no-op-loop' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-NESTED-FP-LP
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-NESTED-FP-LP: Starting llvm::Module pass manager run
|
|
|
|
; CHECK-NESTED-FP-LP: Starting llvm::Function pass manager run
|
2017-01-11 14:23:21 +08:00
|
|
|
; CHECK-NESTED-FP-LP: Starting Loop pass manager run
|
2016-02-25 15:23:08 +08:00
|
|
|
; CHECK-NESTED-FP-LP: Running pass: NoOpLoopPass
|
2017-01-11 14:23:21 +08:00
|
|
|
; CHECK-NESTED-FP-LP: Finished Loop pass manager run
|
2016-02-25 18:27:39 +08:00
|
|
|
; CHECK-NESTED-FP-LP: Finished llvm::Function pass manager run
|
|
|
|
; CHECK-NESTED-FP-LP: Finished llvm::Module pass manager run
|
2016-02-25 15:23:08 +08:00
|
|
|
|
2020-07-29 08:08:24 +08:00
|
|
|
; RUN: opt -disable-output -debug-pass-manager -debug-pass-manager-verbose \
|
2020-07-19 13:26:37 +08:00
|
|
|
; RUN: -passes='module(no-op-function,no-op-loop,no-op-cgscc,cgscc(no-op-function,no-op-loop),function(no-op-loop))' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-ADAPTORS
|
|
|
|
; CHECK-ADAPTORS: Starting llvm::Module pass manager run
|
2020-12-05 00:30:34 +08:00
|
|
|
; CHECK-ADAPTORS: Running pass: ModuleToFunctionPassAdaptor
|
2020-07-29 08:08:24 +08:00
|
|
|
; CHECK-ADAPTORS: Running pass: NoOpFunctionPass
|
2020-12-05 00:30:34 +08:00
|
|
|
; CHECK-ADAPTORS: Running pass: ModuleToFunctionPassAdaptor
|
|
|
|
; CHECK-ADAPTORS: Running pass: FunctionToLoopPassAdaptor
|
2020-07-29 08:08:24 +08:00
|
|
|
; CHECK-ADAPTORS: Running pass: NoOpLoopPass on Loop at depth 1 containing: %loop
|
2020-12-05 00:30:34 +08:00
|
|
|
; CHECK-ADAPTORS: Running pass: ModuleToPostOrderCGSCCPassAdaptor
|
2020-07-29 08:08:24 +08:00
|
|
|
; CHECK-ADAPTORS: Running pass: NoOpCGSCCPass
|
2020-12-05 00:30:34 +08:00
|
|
|
; CHECK-ADAPTORS: Running pass: ModuleToPostOrderCGSCCPassAdaptor
|
2020-07-19 13:26:37 +08:00
|
|
|
; CHECK-ADAPTORS: Starting CGSCC pass manager run
|
2020-12-05 00:30:34 +08:00
|
|
|
; CHECK-ADAPTORS: Running pass: CGSCCToFunctionPassAdaptor
|
2020-07-29 08:08:24 +08:00
|
|
|
; CHECK-ADAPTORS: Running pass: NoOpFunctionPass
|
2020-12-05 00:30:34 +08:00
|
|
|
; CHECK-ADAPTORS: Running pass: CGSCCToFunctionPassAdaptor
|
|
|
|
; CHECK-ADAPTORS: Running pass: FunctionToLoopPassAdaptor
|
2020-07-29 08:08:24 +08:00
|
|
|
; CHECK-ADAPTORS: Running pass: NoOpLoopPass on Loop at depth 1 containing: %loop
|
2020-07-19 13:26:37 +08:00
|
|
|
; CHECK-ADAPTORS: Finished CGSCC pass manager run
|
2020-12-05 00:30:34 +08:00
|
|
|
; CHECK-ADAPTORS: Running pass: ModuleToFunctionPassAdaptor
|
2020-07-19 13:26:37 +08:00
|
|
|
; CHECK-ADAPTORS: Starting llvm::Function pass manager run
|
2020-12-05 00:30:34 +08:00
|
|
|
; CHECK-ADAPTORS: Running pass: FunctionToLoopPassAdaptor
|
2020-07-29 08:08:24 +08:00
|
|
|
; CHECK-ADAPTORS: Running pass: NoOpLoopPass on Loop at depth 1 containing: %loop
|
2020-07-19 13:26:37 +08:00
|
|
|
; CHECK-ADAPTORS: Finished llvm::Function pass manager run
|
|
|
|
; CHECK-ADAPTORS: Finished llvm::Module pass manager run
|
|
|
|
|
|
|
|
; RUN: opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='cgscc(print)' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-PRINT-IN-CGSCC
|
|
|
|
; CHECK-PRINT-IN-CGSCC: Starting llvm::Module pass manager run
|
|
|
|
; CHECK-PRINT-IN-CGSCC: Starting CGSCC pass manager run
|
2020-07-29 08:08:24 +08:00
|
|
|
; CHECK-PRINT-IN-CGSCC: Running pass: PrintFunctionPass
|
2020-07-19 13:26:37 +08:00
|
|
|
; CHECK-PRINT-IN-CGSCC: Finished CGSCC pass manager run
|
|
|
|
; CHECK-PRINT-IN-CGSCC: Running pass: VerifierPass
|
|
|
|
; CHECK-PRINT-IN-CGSCC: Finished llvm::Module pass manager run
|
|
|
|
|
2016-08-03 11:21:41 +08:00
|
|
|
; RUN: not opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='function(no-op-function)function(no-op-function)' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-MISSING-COMMA1
|
2018-10-17 18:36:23 +08:00
|
|
|
; CHECK-MISSING-COMMA1: invalid pipeline 'function(no-op-function)function(no-op-function)'
|
2016-08-03 11:21:41 +08:00
|
|
|
|
|
|
|
; RUN: not opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='function()' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-EMPTY-INNER-PIPELINE
|
2018-10-17 18:36:23 +08:00
|
|
|
; CHECK-EMPTY-INNER-PIPELINE: unknown function pass ''
|
2016-08-03 11:21:41 +08:00
|
|
|
|
|
|
|
; RUN: not opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='no-op-module(no-op-module,whatever)' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-PIPELINE-ON-MODULE-PASS
|
2018-10-17 18:36:23 +08:00
|
|
|
; CHECK-PIPELINE-ON-MODULE-PASS: invalid use of 'no-op-module' pass as module pipeline
|
2016-08-03 11:21:41 +08:00
|
|
|
|
|
|
|
; RUN: not opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='no-op-cgscc(no-op-cgscc,whatever)' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-PIPELINE-ON-CGSCC-PASS
|
2018-10-17 18:36:23 +08:00
|
|
|
; CHECK-PIPELINE-ON-CGSCC-PASS: invalid use of 'no-op-cgscc' pass as cgscc pipeline
|
2016-08-03 11:21:41 +08:00
|
|
|
|
|
|
|
; RUN: not opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='no-op-function(no-op-function,whatever)' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-PIPELINE-ON-FUNCTION-PASS
|
2018-10-17 18:36:23 +08:00
|
|
|
; CHECK-PIPELINE-ON-FUNCTION-PASS: invalid use of 'no-op-function' pass as function pipeline
|
2016-08-03 11:21:41 +08:00
|
|
|
|
|
|
|
; RUN: not opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='no-op-loop(no-op-loop,whatever)' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-PIPELINE-ON-LOOP-PASS
|
2018-10-17 18:36:23 +08:00
|
|
|
; CHECK-PIPELINE-ON-LOOP-PASS: invalid use of 'no-op-loop' pass as loop pipeline
|
2016-08-03 11:21:41 +08:00
|
|
|
|
|
|
|
; RUN: not opt -disable-output -debug-pass-manager \
|
|
|
|
; RUN: -passes='no-op-function()' %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-EMPTY-PIPELINE-ON-PASS
|
2018-10-17 18:36:23 +08:00
|
|
|
; CHECK-EMPTY-PIPELINE-ON-PASS: invalid use of 'no-op-function' pass as function pipeline
|
|
|
|
|
|
|
|
; RUN: not opt -passes='no-op-module,bad' \
|
|
|
|
; RUN: /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=CHECK-UNKNOWN-MODULE
|
2018-10-17 19:01:15 +08:00
|
|
|
; CHECK-UNKNOWN-MODULE: unknown module pass 'bad'
|
2018-10-17 18:36:23 +08:00
|
|
|
|
|
|
|
; RUN: not opt -passes='no-op-loop,bad' \
|
|
|
|
; RUN: /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=CHECK-UNKNOWN-LOOP
|
2018-10-17 19:01:15 +08:00
|
|
|
; CHECK-UNKNOWN-LOOP: unknown loop pass 'bad'
|
2018-10-17 18:36:23 +08:00
|
|
|
|
|
|
|
; RUN: not opt -passes='no-op-cgscc,bad' \
|
|
|
|
; RUN: /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=CHECK-UNKNOWN-CGSCC
|
2018-10-17 19:01:15 +08:00
|
|
|
; CHECK-UNKNOWN-CGSCC: unknown cgscc pass 'bad'
|
2018-10-17 18:36:23 +08:00
|
|
|
|
|
|
|
; RUN: not opt -passes='no-op-function,bad' \
|
|
|
|
; RUN: /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=CHECK-UNKNOWN-FUNCTION
|
|
|
|
; RUN: not opt -passes='function(bad,pipeline,text)' \
|
|
|
|
; RUN: /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=CHECK-UNKNOWN-FUNCTION
|
|
|
|
; RUN: not opt -passes='module(no-op-module,function(bad,pipeline,text))' \
|
|
|
|
; RUN: /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=CHECK-UNKNOWN-FUNCTION
|
|
|
|
; RUN: not opt -passes='no-op-module,function(bad,pipeline,text)' \
|
|
|
|
; RUN: /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=CHECK-UNKNOWN-FUNCTION
|
|
|
|
; RUN: not opt -passes='module(cgscc(function(bad,pipeline,text)))' \
|
|
|
|
; RUN: /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=CHECK-UNKNOWN-FUNCTION
|
2018-10-17 19:01:15 +08:00
|
|
|
; CHECK-UNKNOWN-FUNCTION: unknown function pass 'bad'
|
2018-10-17 18:36:23 +08:00
|
|
|
|
|
|
|
; RUN: not opt -aa-pipeline=bad -passes=no-op-function \
|
|
|
|
; RUN: /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=AA-PIPELINE-ERR
|
|
|
|
; AA-PIPELINE-ERR: unknown alias analysis name 'bad'
|
|
|
|
; RUN: opt -passes-ep-peephole=bad -passes=no-op-function \
|
|
|
|
; RUN: /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=PASSES-EP-PEEPHOLE-ERR
|
|
|
|
; PASSES-EP-PEEPHOLE-ERR: Could not parse -passes-ep-peephole pipeline: unknown function pass 'bad'
|
|
|
|
; RUN: opt -passes-ep-late-loop-optimizations=bad -passes=no-op-function \
|
|
|
|
; RUN: /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=PASSES-EP-LATELOOPOPT-ERR
|
|
|
|
; PASSES-EP-LATELOOPOPT-ERR: Could not parse -passes-ep-late-loop-optimizations pipeline: unknown loop pass 'bad'
|
|
|
|
; RUN: opt -passes-ep-loop-optimizer-end=bad -passes=no-op-function \
|
|
|
|
; RUN: /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=PASSES-EP-LOOPOPTEND-ERR
|
|
|
|
; PASSES-EP-LOOPOPTEND-ERR: Could not parse -passes-ep-loop-optimizer-end pipeline: unknown loop pass 'bad'
|
|
|
|
; RUN: opt -passes-ep-scalar-optimizer-late=bad -passes=no-op-function \
|
|
|
|
; RUN: /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=PASSES-EP-SCALAROPTLATE-ERR
|
|
|
|
; PASSES-EP-SCALAROPTLATE-ERR: Could not parse -passes-ep-scalar-optimizer-late pipeline: unknown function pass 'bad'
|
|
|
|
; RUN: opt -passes-ep-cgscc-optimizer-late=bad -passes=no-op-function \
|
|
|
|
; RUN: /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=PASSES-EP-CGSCCOPTLATE-ERR
|
|
|
|
; PASSES-EP-CGSCCOPTLATE-ERR: Could not parse -passes-ep-cgscc-optimizer-late pipeline: unknown cgscc pass 'bad'
|
|
|
|
; RUN: opt -passes-ep-vectorizer-start=bad -passes=no-op-function \
|
|
|
|
; RUN: /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=PASSES-EP-VECTORIZERSTART-ERR
|
|
|
|
; PASSES-EP-VECTORIZERSTART-ERR: Could not parse -passes-ep-vectorizer-start pipeline: unknown function pass 'bad'
|
|
|
|
; RUN: opt -passes-ep-pipeline-start=bad -passes=no-op-function \
|
|
|
|
; RUN: /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=PASSES-EP-PIPELINESTART-ERR
|
|
|
|
; PASSES-EP-PIPELINESTART-ERR: Could not parse -passes-ep-pipeline-start pipeline: unknown pass name 'bad'
|
2020-11-20 01:38:14 +08:00
|
|
|
; RUN: opt -passes-ep-pipeline-early-simplification=bad -passes=no-op-function \
|
|
|
|
; RUN: /dev/null -disable-output 2>&1 | FileCheck %s -check-prefix=PASSES-EP-PIPELINEEARLYSIMPLIFICATION-ERR
|
|
|
|
; PASSES-EP-PIPELINEEARLYSIMPLIFICATION-ERR: Could not parse -passes-ep-pipeline-early-simplification pipeline: unknown pass name 'bad'
|
2016-02-25 15:23:08 +08:00
|
|
|
|
2014-01-12 17:34:22 +08:00
|
|
|
define void @f() {
|
2016-02-25 15:23:08 +08:00
|
|
|
entry:
|
|
|
|
br label %loop
|
|
|
|
loop:
|
|
|
|
br label %loop
|
2014-01-12 17:34:22 +08:00
|
|
|
}
|