This trades off more compile time for less peak memory usage. Right now
it invalidates all function analyses after a module->function or
cgscc->function adaptor.
https://llvm-compile-time-tracker.com/compare.php?from=1fb24fe85a19ae71b00875ff6c96ef1831dcf7e3&to=cb28ddb063c87f0d5df89812ab2de9a69dd276db&stat=instructions
https://llvm-compile-time-tracker.com/compare.php?from=1fb24fe85a19ae71b00875ff6c96ef1831dcf7e3&to=cb28ddb063c87f0d5df89812ab2de9a69dd276db&stat=max-rss
For now this is just experimental.
See comments on why this may affect optimizations.
I think this could be more precise about what "invalidate more analyses" means. From the implementation, my understanding is that analyses will be invalidated after a function pass manager finishes processing a function.
Makes me wonder if we shouldn't be handling this in the Function to CGSCC/Module pass manager adaptors.