Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
Looks good. Could you include some comparison numbers, if you have them, in the commit message? (What target did you test (clang is an easy one), time and memory usage would be good to know)
Oh, wait. This will increase memory usage by copying the strings into the string map which is is unfortunate... Any way to avoid that?
My bad... I forgot to convert const char * to StringRef.
StringRef alone doesn't seem to do any copy. StringMap copies the key into the map. The old implementation uses const char * and has none of such problem. I can think of no other way to it if we persist using StringMap.
StringMap clones the strings. DenseMap<CachedHashStringRef, uint32_t> may be more efficient.
Yeah - maybe lld has something that can be generalized and avoids this issue. I think it also has multithreading in string merging too.