I'm writing a mini Fortran compiler using Flex and Bison. Up to now I've finished the lexical and syntax analysis. I'm in the semantic analysis in type checking and I must now choose an IR. My target machine is MIPS. So I want final code generation based on MIPS IAS. So a good IR I believe are quadruples. But I want to introduce some optimizations. For that reason I've built a DAG structure (using a hash table). There are 2 paths for IR: quadruples or DAG and then quadruples.
If I go with DAG as my IR, how could I use the backpatching method for statements? With quadruples it'd be easy. The DAG on the other way is more abstract. I'll be forced to convert it to quadruples. I know that. My fear is backpatching.