From 435f129d8a02ba24670a3959baa91013fc3d25df Mon Sep 17 00:00:00 2001 From: Joe Savona Date: Wed, 28 May 2025 22:27:15 -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]