See https://llvm.org/bugs/show_bug.cgi?id=22606 for more discussion.
Most of the changes in this patch are file reorganization to help ensure assumptions about how __thread_specific_pointer is used hold. The assumptions are:
- __thread_specific_ptr<Tp> is only created with a __thread_struct pointer.
- __thread_specific_ptr<Tp> can only be constructed inside the __thread_local_data() function.
I'll remove the comments before committing. They are there for clarity during review.