From cf7f30c3179e7088d2b325f92cb017a2438b5d45 Mon Sep 17 00:00:00 2001 From: Joe Savona Date: Wed, 4 Jun 2025 17:00:28 -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]