find_idempotence() is inefficient
Specifically, the inner fixed point iteration (to see if an instruction depends on itself) can be replaced with a faster check if all the instructions are considered at once (I am thinking specifically about replacing it with an SCC check: build the dependency graph and then check if the instruction is the only member of its SCC).