This will allow targets more flexibility to replace the
register allocator core passes. In a future commit,
AMDGPU will run the core register assignment passes
twice, and will also want to disallow using the
standard -regalloc option.
LGTM, one last nitpick below.
Add a comment on the declaration of addPreRewrite that it may not be honored if the target overloads addRegAssignAndRewriteOptimized or more generally doesn't actually have two distinct passes (e.g., the fast variant wouldn't call into addPreRewrite).