The MIPS backend attempts to combine integer multiply and addition or subtraction into a madd or msub operation. This optimization is heavily restricted due to its utility in many cases. PR/51114 highlighted that the optimization was performed on an associative basis which is correct in the `add` case but not in the `sub` case. Resolve this bug by performing an early exit in the case where the multiply is the LHS operand of the subtraction. This resolves PR/51114. Thanks to digitalseraphim for reporting the issue! Differential Revision: https://reviews.llvm.org/D124742
193 KiB
193 KiB