This patch is motivated by the case I added in PowerPC/fma-combine.ll, and we hit an assertion here due to somewhat the same reason as https://reviews.llvm.org/D70975 . The case is narrowed down from spec and it is important to us. Though we have some hack, it still failed with my case, as the operand 0 now is NOT a const fp, it is another fma that with const fp. And that const fp is negated which result in multi-uses.
So, I think a better fix is to check the uses of the negated const fp. If there are already use of its negated value, we will have benefit as no extra Node is added.
This is difficult to read. Please add some intermediate names (maybe as shown below).
It's not clear to me if that's the logic we want - is this a good or better fix for the problem?