llvm-6502/test
Chandler Carruth 9fc5a53118 [PM] Fix a pretty nasty bug where the new pass manager would invalidate
passes too many time.

I think this is actually the issue that someone raised with me at the
developer's meeting and in an email, but that we never really got to the
bottom of. Having all the testing utilities made it much easier to dig
down and uncover the core issue.

When a pass manager is running many passes over a single function, we
need it to invalidate the analyses between each run so that they can be
re-computed as needed. We also need to track the intersection of
preserved higher-level analyses across all the passes that we run (for
example, if there is one module analysis which all the function analyses
preserve, we want to track that and propagate it). Unfortunately, this
interacted poorly with any enclosing pass adaptor between two IR units.
It would see the intersection of preserved analyses, and need to
invalidate any other analyses, but some of the un-preserved analyses
might have already been invalidated *and recomputed*! We would fail to
propagate the fact that the analysis had already been invalidated.

The solution to this struck me as really strange at first, but the more
I thought about it, the more natural it seemed. After a nice discussion
with Duncan about it on IRC, it seemed even nicer. The idea is that
invalidating an analysis *causes* it to be preserved! Preserving the
lack of result is trivial. If it is recomputed, great. Until something
*else* invalidates it again, we're good.

The consequence of this is that the invalidate methods on the analysis
manager which operate over many passes now consume their
PreservedAnalyses object, update it to "preserve" every analysis pass to
which it delivers an invalidation (regardless of whether the pass
chooses to be removed, or handles the invalidation itself by updating
itself). Then we return this augmented set from the invalidate routine,
letting the pass manager take the result and use the intersection of
*that* across each pass run to compute the final preserved set. This
accounts for all the places where the early invalidation of an analysis
has already "preserved" it for a future run.

I've beefed up the testing and adjusted the assertions to show that we
no longer repeatedly invalidate or compute the analyses across nested
pass managers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225333 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-07 01:58:35 +00:00
..
Analysis IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
Assembler Change the .ll syntax for comdats and add a syntactic sugar. 2015-01-06 22:55:16 +00:00
Bindings [OCaml] Fix bitrot in tests. 2014-12-30 03:24:14 +00:00
Bitcode IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
BugPoint IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
CodeGen R600/SI: Add combine for isinfinite pattern 2015-01-06 23:00:46 +00:00
DebugInfo Revert "Reapply: Teach SROA how to update debug info for fragmented variables." 2015-01-06 19:47:27 +00:00
ExecutionEngine Small model and JIT generally don't go well with each other. 2014-11-25 17:14:22 +00:00
Feature Change the .ll syntax for comdats and add a syntactic sugar. 2015-01-06 22:55:16 +00:00
FileCheck FileCheck: Add a flag to allow checking empty input 2014-08-07 18:40:37 +00:00
Instrumentation Change the .ll syntax for comdats and add a syntactic sugar. 2015-01-06 22:55:16 +00:00
Integer
JitListener IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
Linker Change the .ll syntax for comdats and add a syntactic sugar. 2015-01-06 22:55:16 +00:00
LTO llvm-lto: Add testing coverage for local contexts 2014-12-17 02:00:38 +00:00
MC [Hexagon] Adding compound jump encodings. 2015-01-06 20:03:31 +00:00
Object Don't loop endlessly for MachO files with 0 ncmds 2015-01-06 17:08:26 +00:00
Other [PM] Fix a pretty nasty bug where the new pass manager would invalidate 2015-01-07 01:58:35 +00:00
SymbolRewriter Transform: add SymbolRewriter pass 2014-11-07 21:32:08 +00:00
TableGen [AVX512] Added intrinsics for VPCMPEQB and VPCMPEQW. 2014-09-30 11:32:22 +00:00
tools Change the .ll syntax for comdats and add a syntactic sugar. 2015-01-06 22:55:16 +00:00
Transforms Fix using wrong intrinsic in test 2015-01-06 23:00:33 +00:00
Unit Let test/Unit/lit.cfg add config.shlibdir to $PATH on DLL platforms like cygming. 2014-07-04 05:11:55 +00:00
Verifier Change the .ll syntax for comdats and add a syntactic sugar. 2015-01-06 22:55:16 +00:00
YAMLParser [Support][YAML] Add support for accessing tags and tag handle substitution. 2013-10-18 22:38:04 +00:00
.clang-format Add .clang-format without column limit to subdirectory tests/. 2013-11-19 04:26:05 +00:00
CMakeLists.txt Revert r224149, llvm-dsymutil was already here. 2014-12-12 21:25:07 +00:00
lit.cfg llvm/test/lit.cfg: have_ld_plugin_support(): Use decode() for stdout. 2015-01-05 14:18:04 +00:00
lit.site.cfg.in [lit] Make config.llvm_lib_dir available on cmake, too. 2014-12-30 03:24:11 +00:00
Makefile [lit] Make config.llvm_lib_dir available on cmake, too. 2014-12-30 03:24:11 +00:00
Makefile.tests Remove dead code from the makefile build system. 2013-07-25 20:25:31 +00:00
TestRunner.sh Use exec. 2010-08-29 14:49:00 +00:00