mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-02 12:35:56 +01:00
Now that the total number of IRs is available from SemIR::File, we can use FixedSizeValueStore to store/look up values mapped from a CheckIRId instead of a Map, which is demonstrably faster (unsurprisingly, since it's just a vector index). See #6019. This replaces a Map with FixedSizeValueStore in Lower::Context for use in `GetFileContext()`. This function is used in some places that can become hot, such as `HandleInst()` and `GetType()`. In our current lowering tests, there's no measurable performance change from this PR, but based on #6019 we can expect to see one as the amount of instructions being lowered increases. Using a FixedSizeValueStore when possible is a better approach than a map, generally.