Currently, we permit -mtp=cp15 even for targets that don't implement the TLS register. When building for ARMv6 or earlier, this means we emit instructions that will UNDEF at runtime. For Thumb1, passing -mtp=cp15 will trigger an assert in the backend.
So let's add some diagnostics to ensure that -mtp=cp15 is only accepted for ARMv6T2 or newer.
The last two checks seems redundant (getARMSubArchVersionNumber(Triple) < 7 && llvm::ARM::parseArch(Triple.getArchName()) != llvm::ARM::ArchKind::ARMV6T2). If the ArchKind was ARMV6T2 then getARMSubArchVersionNumber should return 6.
Or do we want to support ARMv6T2, in which case the patch description should be edited:
s/ARMv6T2 or earlier/ARMv6 (except ARMv6T2) or earlier/