Commits

John McCall committed 7dd9f5f037c
Improve IRGen's infrastructure for caching local type data. There are several interesting new features here. The first is that, when emitting a SILFunction, we're now able to cache type data according to the full dominance structure of the original function. For example, if we ask for type metadata, and we've already computed it in a dominating position, we're now able to re-use that value; previously, we were limited to only doing this if the value was from the entry block or the LLVM basic block matched exactly. Since this tracks the SIL dominance relationship, things in IRGen which add their own control flow must be careful to suppress caching within blocks that may not dominate the fallthrough; this mechanism is currently very crude, but could be made to allow a limited amount of caching within the conditionally-executed blocks. This query is done using a proper dominator tree analysis, even at -O0. I do not expect that we will frequently need to actually build the tree, and I expect that the code-size benefits of doing a real analysis will be significant, especially as we move towards making more metadata lazily computed. The second feature is that this adds support for "abstract" cache entries, which indicate that we know how to derive the metadata but haven't actually done so. This code isn't yet tested, but it's going to be the basis of making a lot of things much lazier.