InstCombine didn't perform the transformations when fmul's operands were the same instruction because it required to have one use for each of them which is false in the case. This patch fixes this + adds tests for them and introduces a new function isOnlyUserOfAnyOperand to check these cases in a single place.
This patch is a result of discussion in https://reviews.llvm.org/D102574.
Don't expose isRestrictiveUseConstraintMet in the header if you don't plan to use it anywhere.