compiler IR design is difficult and there are many subtleties. Nikita Popov talks about a few aspects of this for LLVM.https://www.youtube.com/watch?v=gIQEZ3QJz1w