On Wed Nov 22 17:35:36 2023 +0000, Zebediah Figura wrote:
Having this as an optimization is fine, if perhaps unnecessary, but why compare the timestamp here? Why would that cause problems?
This is mostly about having strong assertions than optimizing, since it is easy to mess up when we change copy-prop.
I am relying, both in copy_propagation_set_value() and here in copy_propagation_invalidate_variable(), in the following assertion:
``` assert(!trace->record_count || trace->records[trace->record_count - 1].timestamp < time); ``` which basically means that no record should be added before the last record, if there is any.
Currently, there is only one exception to this rule: copy_propagation_invalidate_from_block() can actually try to add two or more invalidations at the same time stamp that was passed as argument (if the variable is dynamically written more than once in the block), so this `if` is here to handle this very specific case, and the optimization is a nicety.