If the option -rthread-register=<register-name> is specified then:
- Protect rthread register from register allocation.
- Add rhread register as a base pointer to pointer operand of load and store instructions if the pointer operand has addrspace(X), where X is specified with -rthread-addrspace option (256 by default).
This pass might be useful for Thread Local Access operations with a dedicated TLS register.
RThreadAccess is added to X86 and AArch64 pipeline in addPreISel() and can be added to other targets as needed.
global option codegen options like this are bad. If this is for more than debugging it should be a function attribute or something