For certain intrinsics (e.g. stack/code related ones), the address space
always has to be the alloca address space defined in the DataLayout and
there will not be another version of that intrinsic using other address
spaces in the same module.
This change adds new llvm_{prog,alloca,global}_ptr_ty to Intrinsics.td.
It only adds the infrastructure, follow-up commits will use it for e.g.
va_start,va_copy,va_end,returnaddress, etc.
The motivating use case here are the downstream CHERI targets
that use address space 200 for alloca/program/globals. So far CHERI LLVM
overloaded all those intrinsics but this caused a lot of downstream merge
conflicts in test files, so this approach may be more maintainable.
The alternative would be to overload all the remaining intrinsics but that
causes a lot of test churn (especially for llvm.va_*/llvm.stack{save,restore}*)
and should not be necessary since those intrinsics don't really need to
be overloaded, the types just happen to depend on the data layout string.
Just AddrSpace sounds like it's expecting the raw number, like in LLVMQualPointerType