This addresses https://github.com/llvm/llvm-project/issues/51066.
Prior to this, dso_local_equivalent would lead to an llvm_unreachable in a switch in the FunctionComparator. This adds a conservative case in that switch that just compares the underlying functions.
Based on your check lines, it doesn't look like the functions actually get merged? You probably need to add some dummy instructions to pass the instruction threshold, or use internal linkage.