Passing global caches to optimizer.