In Android, we have been noticing a few builds taking longer than usual (18-20 mins) at linking steps. When we disabled CFI, those same builds would take few seconds. I am no sure why CFI is causing the big difference.
I have attached reproducer for a specific test in AOSP to showcase the difference for both the CFI (repro-cfi-*.tar) and non-CFI (repro-no-cfi-*.tar) versions. You can just run ld.lld @response.txt after running tar -xf <tar-file>. There is both a 64-bit version and 32-bit version of the test. In addition, I attached the tests' bitcodes when we build with CFI because it might be due to other passes since Android has LTO on by default. Here is the link: https://drive.google.com/drive/folders/1i2tLBUJAnoGJkqtuJpGA9PUwmv1856DO?usp=sharing