You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to the discussion here, to associate arbitrary data with Operations (or Types) in analyses / transforms, we currently need to use a hash table (such as FxHashMap<Ptr<Operation>, _>).
Providing an aux or scratch field within Operation itself allows using the field as an index into an array (i.e., faster than hashing) that can contain any data.
A safe way of providing such a field, so that different analyses or transforms do not end up reading a stale value from a previous pass, is to associate each (dynamic) user (an analysis or transform instance) of the field with an aux_field_user_id, that is unique to that instance of the pass. A sample implementation:
Every pass (analysis or transform), each time it runs, will call Context::get_new_aux_user_id and use that aux_user_id each time it sets or gets the aux data.
The text was updated successfully, but these errors were encountered:
Similar to the discussion here, to associate arbitrary data with
Operation
s (orType
s) in analyses / transforms, we currently need to use a hash table (such asFxHashMap<Ptr<Operation>, _>
).Providing an aux or scratch field within
Operation
itself allows using the field as an index into an array (i.e., faster than hashing) that can contain any data.A safe way of providing such a field, so that different analyses or transforms do not end up reading a stale value from a previous pass, is to associate each (dynamic) user (an analysis or transform instance) of the field with an
aux_field_user_id
, that is unique to that instance of the pass. A sample implementation:Every pass (analysis or transform), each time it runs, will call
Context::get_new_aux_user_id
and use thataux_user_id
each time it sets or gets the aux data.The text was updated successfully, but these errors were encountered: