The LLVM's opt -S -mem2reg
pass produces the so-called "pruned" SSA -- the form that has all the dead phi functions removed. I would like to keep those phi instructions in the IR, obtaining the "minimal" SSA, but I'm failing to find an easy way to do it.
Am I doomed to implement the whole SSA construction algorithm from scratch or there is a way to do it with existing tools?