An Intermediate Representation For Expressing And Optimizing Computations In Lattice Quantum Chromodynamics