-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Being able to annotate IR nodes with attributes would be handy in IR analyses and transformations.
Motivating example: Tracking expressions initializing reduction buffers
Currently it's done by saving such expressions in a std::unordered_set
and passing around it. It's still reasonable but would become problematic if we would need to track many sets of different IR nodes. Alternatively, if we could annotate IR nodes, we could mark initialization expressions as such and use that information later without passing around auxiliary containers. Or, we could just create a new IR node for expressions of a particular trait, however, creating a new different class might be overkill in some cases.
A challenge would be attribute consistency. We'd need to make sure IR attributes are kept valid (or invalidated when necessary). Something we may want to revisit in the future.