The TLS sequence for the initial exec access mode currently generates:
addis 4, 2, var_int@got@tprel@ha ld 4, var_int@got@tprel@l(4) add 4, 4, var_int@tls lwz 5, 0(4)
The d-form load can be changed into an x-form load if we check that the input is coming from a special tls add instruction.
addis 3, 2, var_int@got@tprel@ha ld 3, var_int@got@tprel@l(3) lwzx 3, 3, var_int@tls
This patch adds new load/store instructions for integer scalar types and selects these instructions when an ISD::LOAD/STORE is fed by PPCISD::ADD_TLS.