Meredith Julian 5d2fc9408e
[InstCombine] Fix phi scalarization with binop (#169120)
InstCombine phi scalarization would always create a new binary op with
the phi as the first operand, which is not correct for non-commutable
binary ops such as sub. This fix preserves the original binary op
ordering in the new binary op and adds a test for this behavior.
Currently, this transformation can produce silently incorrect IR, and in
the case of the added test, would optimize it out entirely.
2025-11-24 12:48:32 +01:00
..