aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugVariables.cpp
diff options
context:
space:
mode:
authorAndrew Ng <andrew.ng@sony.com>2020-09-09 10:48:21 +0100
committerAndrew Ng <andrew.ng@sony.com>2020-09-16 10:26:11 +0100
commit77152a6b7ac07ce65568d7c69305653e7cad4bb0 (patch)
treeb57020a65ff49b5b92f9c365855db8507330493b /llvm/lib/CodeGen/LiveDebugVariables.cpp
parent6040e2a6d97d9f9445715dfc468c3112f40e2588 (diff)
downloadllvm-77152a6b7ac07ce65568d7c69305653e7cad4bb0.zip
llvm-77152a6b7ac07ce65568d7c69305653e7cad4bb0.tar.gz
llvm-77152a6b7ac07ce65568d7c69305653e7cad4bb0.tar.bz2
[LLD][ELF] Optimize linker script filename glob pattern matching NFC
Optimize the filename glob pattern matching in LinkerScript::computeInputSections() and LinkerScript::shouldKeep(). Add InputFile::getNameForScript() which gets and if required caches the Inputfile's name used for linker script matching. This avoids the overhead of name creation that was in getFilename() in LinkerScript.cpp. Add InputSectionDescription::matchesFile() and SectionPattern::excludesFile() which perform the glob pattern matching for an InputFile and make use of a cache of the previous result. As both computeInputSections() and shouldKeep() process sections in order and the sections of the same InputFile are contiguous, these single entry caches can significantly speed up performance for more complex glob patterns. These changes have been seen to reduce link time with --gc-sections by up to ~40% with linker scripts that contain KEEP filename glob patterns such as "*crtbegin*.o". Differential Revision: https://reviews.llvm.org/D87469
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
0 files changed, 0 insertions, 0 deletions