On Wed Nov 22 18:59:23 2023 +0000, Francisco Casas wrote:
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.
The assertion is good, but you could just as easily change the < to a <=, right?