ConstantValue is defined as { Attribute constant; Dialect *dialect; }.
ConstantValue::dialect specifies how we can materialize the Attribute contant into an op. If two ConstantValues have the same constant but different dialects, then they are still unequal because they would materialize into different ops. This means that joining them still results in an unknown constant.