Provably Efficient Coscheduling of Computation and Memory through Disentanglement