Write coalescing combines write accesses that
- Write the same llvm::Value.
- Write to the same array.
- Unless they do not write anything in a statement instance (partial writes), write to the same element.
- There is no other access between them that accesses the same element.
This is particularly useful after DeLICM, which leaves partial writes to disjoint domains.
After commit, some common code could be refactored:
- makeValueSet() is the same principle as used by DeLICM's makeValueSet(). They could both using some common Scop infrastructure to get unique ids for llvm::Values.
- removeOverwrites() also uses a "backwards scan over accesses". They could be merged into the same function.