The downside of that approach is that the compiler doesn't have access to runtime information, or implementation details of the CPU (e.g. how many internal registers it has).
The Mill architecture supposedly does this; the ISA has three variants for different product lines.