Commit Graph

2 Commits

Author SHA1 Message Date
Chandler Carruth
350138bff9 [PM] Relax the patterns used in the new test I added because some
compilers don't print the typedef name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294729 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 08:48:50 +00:00
Chandler Carruth
1587018791 [PM] Fix a bug in the new loop PM when handling functions with no loops.
Without any loops, we don't even bother to build the standard analyses
used by loop passes. Without these, we can't run loop analyses or
invalidate them properly. Unfortunately, we did these things in the
wrong order which would allow a loop analysis manager's proxy to be
built but then not have the standard analyses built. When we went to do
the invalidation in the proxy thing would fall apart. In the test case
provided, it would actually crash.

The fix is to carefully check for loops first, and to in fact build the
standard analyses before building the proxy. This allows it to
correctly trigger invalidation for those standard analyses.

An alternative might seem to be  to look at whether there are any loops
when doing invalidation, but this doesn't work when during the loop
pipeline run we delete the last loop. I've even included that as a test
case. It is both simpler and more robust to defer building the proxy
until there are definitely the standard set of analyses and indeed
loops.

This bug was uncovered by enabling GlobalsAA in the pipeline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294728 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 08:26:58 +00:00