From 755758710f8cba0049ffec75364d17bbab4bcb47 Mon Sep 17 00:00:00 2001 From: Joe Savona Date: Fri, 6 Jun 2025 12:41:47 -0700 Subject: [PATCH] Update base for Update on "[compiler] Add ImmutableCapture effect, CreateFrom no longer needs Capture" ImmutableCapture allows us to record information flow for escape analysis purposes, without impacting mutable range analysis. All of Alias, Capture, and CreateFrom now downgrade to ImmutableCapture if the `from` value is frozen. Globals and primitives are conceptually copy types and don't record any information flow at all. I guess we could add a `Copy` effect if we wanted but i haven't seen a need for it yet. Related, previously CreateFrom was always paired with Capture when constructing effects. But I had also coded up the inference to sort of treat them the same. So this diff makes that official, and means CreateFrom is a valid third way to represent data flow and not just creation. When applied, CreateFrom will turn into: ImmutableCapture for frozen values, Capture for mutable values, and disappear for globals/primitives. A final tweak is to change range inference to ensure that range.start is non-zero if the value is mutated. [ghstack-poisoned]