I ran into an issue where LLD wasn't de-duplicating type units (TU) with local
ThinLTO. A case is where one TU came from bitcode file build with local ThinLTO,
and another TU came from pre-build ELF object.
With distributed ThinLTO everything was de-duplicated as expected since inputs to
final link are just ELF files. This is a variation of if both type units come
from ThinLTO.
I took a look at https://reviews.llvm.org/D80765, which seems to go nowhere and
primarily just dealt with type units that come from ThinLTO. Due to it's
implementation it wouldn't work for mix mode.
Here I propose a more localized fix for this that just deals with type units. It
deals with a case where all type units come from ThinlTO, and with mix mode
case, and makes it so that behavior is the same between regular and distributed
ThinLTO.
P.S. I will add tests after it's clear that this isn't a dead end.