Rewrite StoreInputs/StoreOuputs for new DAG structure.