Use an enum FlatInstVariant to differentiate between the different
variants of flat instructions (flat, global and scratch).
This should make it easier to bundle the immediate offset logic in a
single place and implement restrictions and bug workarounds.
Fixed version of D99587, which does not rely on the address space.
clang-tidy: warning: invalid case style for function 'SelectFlatOffsetImpl' [readability-identifier-naming]
not useful