[lit] [compiler-rt] Add llvm-lit global command cache to speed up test config (#195888)
Compiler-rt lit test discovery takes quite a while on Darwin (i.e. the
time from when you launch llvm-lit to when the first test runs can be
minutes for check-compiler-rt). This appears to be mostly due to
subprocess calls during test configuration.
This adds a memoized command-runner to llvm-lit, so that lit.cfg.py
scripts can re-use the result of feature-detection commands when running
multiple test suites at once. I've adopted it for several subprocess
calls in compiler-rt.
rdar://175893448