The way that we've done it in libclc, we've got .ll files with atomic
definitions for address spaces 1 and 3 (the old global/local). It's
then up to each back-end that we target to decide how to map those
numbers. Up to now, we've had no need to implement (and no good way to
test) other numeric address spaces and map them, and at the moment, I
believe that the r600/amdgcn targets both share a definition of
address spaces 1/3 as global/local.
We can fairly easily add definitions for other numeric address spaces
(low technical difficulty, medium tediousness), but we might have to
move a few things around to split out those numeric mappings to be
per-target (I'm assuming that the r600 target will keep the old
mappings, feel free to correct me).