Fixes PR36823.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
ruiu informs me similar code exists in the other ports. Let's get this reviewed first and then I'll update the others.
Generally looking good.
lld/COFF/ICF.cpp | ||
---|---|---|
205–208 ↗ | (On Diff #139218) | This doubles the total number of computation because you call findBoundary calls twice for each iteration. I wonder if we need to parallelize this in the first place. Maybe it is better to do this with a regular for loop? |
210–213 ↗ | (On Diff #139218) | I would allocate NumShards+1 elements for Boundaries and set Boundaries[0] to 0, so that we don't need to special-case I==0. |
This passes tests and links all of chromium without tsan failures, but the resulting component_unittests.exe crashes.
This now generates a components_unittests.exe that is the same size as without this change that works correctly. I also verified that the data race is gone on COFF. I will land this to give the bots a chance to chew on it, and then fix the same data race in the ELF linker.