Precompute some information about register costs.