[compiler-rt] [llvm] [MC/DC][Coverage] Introduce "Bitmap Bias" for continuous mode (PR #96126)
Petr Hosek via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 1 01:42:11 PDT 2024
petrhosek wrote:
This is something we discussed internally when reviewing the MC/DC changes. There are two different design directions we can take here: use a separate bias for the bimap (as done in this change), or use the same bias for both counters and bitmap.
The downside of using separate biases is that it can have significant negative performance impact. We intentionally load the counter bias at the beginning of the function, with the motivation being that unless we're under register pressure, the register allocator will use the same register throughout the entire function, reducing the number of loads. This has been the case in practice from what we've observed. Using a second bias is likely going to increase register pressure, especially on register-starved architectures like x86, and require more frequent loads for the bias.
A more efficient alternative would be to use a single bias for both counters and bitmap. That would require the counters and the bitmap section being at a fixed offset, ideally right next to each other. In ELF, we might be able to achieve this using `SHF_LINK_ORDER` but we haven't tested this to see if it's really feasible. We also don't know if there's a way to represent this in COFF and Mach-O, that's something we would need to look into.
https://github.com/llvm/llvm-project/pull/96126
More information about the llvm-commits
mailing list