When comparing basic blocks, there is an additional check that two
Value*'s should have the same ID, which interferes with merging equivalent
constants of different kinds (such as a ConstantInt and a ConstantPointerNull
in the included testcase). The cmpValues function already ensures that the
two values in each function are the same, so removing this check should not
cause incorrect merging.
Also, the type comparison is redundant, based on reviewing the code and
testing on the test suite and several large LTO bitcodes.
Bikeshed: CHECKNOT-NOT is a bit weird. MERGED-NOT would be nicer.