Checkpointing was discussed in a couple of RFCs:
https://discourse.llvm.org/t/rfc-local-per-component-ir-checkpointing/69071
https://discourse.llvm.org/t/rfc-lightweight-llvm-ir-checkpointing/68446
This set of patches implement the former local per-component checkpointing.
In short checkpointing provides a simple API for saving and restoring parts
of the IR state. For example if we want to save/restore the state of BB:
auto Chkpnt = Context.getCheckpoint(); Chkpnt.track(BB); // Make changes to instructions in `BB` Chkpnt.restore();
This patch includes the main body of the checkpointing infrastructure and also
implements part of tracking name changes of a BasicBlock component.