Sharing llvm IR infrastructure for Equality saturation

I’ve started hacking up a branch with a rough implementation of equality saturation. This needs me to add objects such as PEGBasicBlock, PEGInstruction, PEGTerminatorInstruction, etc. (PEG stands for “program expression block”). I wish to share most of the infrastructure that exists - I believe this is already done with Machine*.

How do I do this for PEGs? I’d also like to get analysis passes for “free” - particularly, dominance and loop analyses.


Hi Siddzharth,

Is it possible to implement equality saturation directly on (a subset of) LLVM IR, such that you don’t need to create yet-another compiler IR?