Several classes in the optimizing compiler currently provide scratch fields that optimizations can use to save data. This approach has serious drawbacks (e.g. waste of space, data is not close to the computation, possibility of overwriting data, ...). We should remove all scratch fields from the IR classes and rewrite all affected parts of the opt compiler to save data in separate data structures, e.g. in the compiler phase objects or in the IR object.
The following scratch fields have already been removed during work on this issue:
RegisterOperand.scratchObject (renamed because it had a single responsibility after refactoring)
SpaceEffGraphEdge.scratch (renamed due to not being a scratch field)