Need guidance on building DL compiler

me and my team are trying to build a deep learning compiler . corrrect me if i am wrong , building a own IR representation is too hard and takes months to even build a simple one . so instead of wasting time building our own IR , we have decided to use existing IR , between the choices of StableHLO and Relay. we decided to use Relay. as we have fixed on the IR , we thought we will only focus on the optimization part, so i am reading the source code of the transforms folder in tvm , which contains the optimization passes code. i am doing this so that i understand how production optimization code is written. is there any kind of guidance or resources , or giving me a path to follow. anything would be helpful

you can use the relax which is the latest version of IR TVM uses. You can try to look into tutorials like End-to-End Optimize Model — tvm 0.22.dev0 documentation

so is it better than relay? i want to know other thing also , is there any feasibility of creating new optimisation pass than the already existing ones.